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

问题描述:

这里是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'

回答我的问题

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

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中支持它们两个 –