【问题标题】:use a wsdl with php soapserver使用带有 php soapserver 的 wsdl
【发布时间】:2014-03-27 10:53:28
【问题描述】:

我有一个 wsdl,我必须开发这个 wsdl 中描述的功能

这是wsdl文件

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://pat.it/fiat/wsc" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://www.test.be/test" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://www.test.be/test">
  <s:element name="ProcessRequest">
    <s:complexType>
      <s:sequence>
        <s:element minOccurs="0" maxOccurs="1" name="sXml" type="s:string" />
        <s:element minOccurs="0" maxOccurs="1" name="sFilters" type="s:string" />
      </s:sequence>
    </s:complexType>
  </s:element>
  <s:element name="ProcessRequestResponse">
    <s:complexType>
      <s:sequence>
        <s:element minOccurs="0" maxOccurs="1" name="ProcessRequestResult" type="s:string" />
      </s:sequence>
    </s:complexType>
  </s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="ProcessRequestSoapIn">
<wsdl:part name="parameters" element="tns:ProcessRequest" />
</wsdl:message>
<wsdl:message name="ProcessRequestSoapOut">
<wsdl:part name="parameters" element="tns:ProcessRequestResponse" />
</wsdl:message>
<wsdl:portType name="SelfCareSoap">
<wsdl:operation name="ProcessRequest">
  <wsdl:input message="tns:ProcessRequestSoapIn" />
  <wsdl:output message="tns:ProcessRequestSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SelfCareSoap" type="tns:SelfCareSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="ProcessRequest">
  <soap:operation soapAction="http://www.test.be/test/ProcessRequest" style="document" />
  <wsdl:input>
    <soap:body use="literal" />
  </wsdl:input>
  <wsdl:output>
    <soap:body use="literal" />
  </wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="SelfCareSoap12" type="tns:SelfCareSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="ProcessRequest">
  <soap12:operation soapAction="http://www.test.be/test/ProcessRequest" style="document" />
  <wsdl:input>
    <soap12:body use="literal" />
  </wsdl:input>
  <wsdl:output>
    <soap12:body use="literal" />
  </wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SelfCare">
<wsdl:port name="SelfCareSoap" binding="tns:SelfCareSoap">
  <soap:address location="http://www.test.be/test" />
</wsdl:port>
<wsdl:port name="SelfCareSoap12" binding="tns:SelfCareSoap12">
  <soap12:address location="http://www.test.be/test" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

如您所见,我必须实现一个函数 processRequest 采用 2 个参数“sXml 和 sFilter”并返回特定格式(我认为) 所以在我的php文件中,我写了但是当我查看soapUI时,我看不到方法“processRequest)

$serveurSOAP = new soap_server('http://www.fgab.be/CallCenter_old/server_ws?wsdl');
function ProcessRequest($sXml,$sFilter)
{
    $rep = new StdClass();
    $test = new stdClass();
    $test->LeadID = "";
    $test->ResultCode = "OK";
    $test->ResultDescription = "test";
    $rep->UpdateLeadResult = $test;
    return $rep;
}

//register 
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)? $HTTP_RAW_POST_DATA : "";
$serveurSOAP->service($HTTP_RAW_POST_DATA);

如果我尝试这一行,我会得到一个异常:SOAP-ERROR: Parsing WSDL: Couldn't load from ....

$cli = new SoapClient('http://www.fgab.be/CallCenter_old/server_ws?wsdl');

我是 webservice 的新手,我不明白这个好的开始

感谢您的帮助

【问题讨论】:

    标签: php soap wsdl nusoap


    【解决方案1】:

    请在服务器 WSDL/test.wsdl 上传递正确的文件路径,我认为 wsdl 未加载。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多