以下是WSDL
在Binding部分,它包括:
<wsdl:operation name="SubmitPurchaseOrder">
<soap:operation soapAction="http://tempuri.org/IEBusinessService/SubmitPurchaseOrder" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
它还包括:
<wsdl:operation name="SubmitPurchaseOrder">
<soap12:operation soapAction="http://tempuri.org/IEBusinessService/SubmitPurchaseOrder" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
但是,当我尝试与'soap_version' => SOAP_1_1
建立联系时,我收到的错误是type 'application/soap+xml; charset=utf-8'
答案 0 :(得分:1)
SOAP 1.2和SOAP 1.1之间存在3个主要区别
SOAP 1.2不使用SOAPAction标题行。
SOAP 1.2使用&#34; http://www.w3.org/2003/05/soap-envelope&#34;作为信封名称空间和SOAP 1.1使用 &#34; http://schemas.xmlsoap.org/soap/envelope/&#34;
我从资源获得的好例子:http://www.herongyang.com/Web-Services/Perl-SOAP-1-2-Request-Differences-SOAP-1-1-and-1-2.html位于
之下SOAP 1.1 request:
POST /WSShakespeare.asmx HTTP/1.1
Host: www.xmlme.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://xmlme.com/WebServices/GetSpeech"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetSpeech xmlns="http://xmlme.com/WebServices">
<Request>string</Request>
</GetSpeech>
</soap:Body>
</soap:Envelope>
SOAP 1.2 request:
POST /WSShakespeare.asmx HTTP/1.1
Host: www.xmlme.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<GetSpeech xmlns="http://xmlme.com/WebServices">
<Request>string</Request>
</GetSpeech>
</soap12:Body>
</soap12:Envelope>
答案 1 :(得分:0)
回答我自己的问题
WSDL文件可以表示在同一文件中支持SOAP 1.1和1.2。您可以指定要使用的绑定:
SoapClient::__setLocation()
http://php.net/manual/en/soapclient.setlocation.php
<强> WsHttpBinding的强>
$client->__setLocation('https://api.krollcorp.com/EBusinessTest/Kroll.Dealer.EBusiness.svc/')
<强> basicHttpBinding的强>
$client->__setLocation('https://api.krollcorp.com/EBusinessTest/Kroll.Dealer.EBusiness.svc/Basic')