[英]use a wsdl with php soapserver
我有一个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>
如您所见,我必须实现一个带有2个args“ sXml和sFilter)的processRequest函数,并返回特定格式(我认为)。因此,在我的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错误:解析WSDL:无法从...加载。
$cli = new SoapClient('http://www.fgab.be/CallCenter_old/server_ws?wsdl');
我是web服务的新手,我不知道一个好的开始
谢谢你的帮助
请在服务器WSDL / test.wsdl上传递文件的正确路径,我认为未加载wsdl。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.