2017-09-06 112 views
0

這裏是WSDL此WSDL是否支持Soap 1.1和Soap1.2?

在綁定部分,它包括:

<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

回答我的問題

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') 
1

SOAP 1.2和SOAP之間有3個主要區別1.1

  1. SOAP 1.2使用「application/soap + xml」作爲Content-Type和SOAP 1.1 使用「text/xml」。
  2. SOAP 1.2不使用SOAPAction標題行。

  3. SOAP 1.2用途 「http://www.w3.org/2003/05/soap-envelope」 作爲包絡線的命名空間和SOAP 1.1使用 「http://schemas.xmlsoap.org/soap/envelope/」。

的好榜樣,我從資源得到: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> 
+0

我瞭解肥皂請求中的差異。我在問,給出的WSDL文件是否指示使用Soap 1.2還是Soap 1.1?看來它提供了對兩者的支持,但我不確定。 –

+0

它看起來像你的問題重複這一個: https://stackoverflow.com/questions/736845/can-a-wsdl-indicate-the-soap-version-1-1-or-1-2-of- Web服務 WSDL支持這兩個版本的soap,並且可以在同一個wsdl中支持它們兩個 –