0

Here is the WSDL

In the Binding section, it includes:

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

It also includes:

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

However, when I try to connect with 'soap_version' => SOAP_1_1 I get the error that it is expecting type 'application/soap+xml; charset=utf-8'

ma77c
  • 1,052
  • 14
  • 31

2 Answers2

3

There 3 main difeferences between SOAP 1.2 and SOAP 1.1

  1. SOAP 1.2 uses "application/soap+xml" as Content-Type and SOAP 1.1 uses "text/xml".
  2. SOAP 1.2 does not use SOAPAction header line.

  3. SOAP 1.2 uses "http://www.w3.org/2003/05/soap-envelope" as the envelope namespace and SOAP 1.1 uses "http://schemas.xmlsoap.org/soap/envelope/".

The good example which I got from resource: http://www.herongyang.com/Web-Services/Perl-SOAP-1-2-Request-Differences-SOAP-1-1-and-1-2.html is below

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>
Iurii Kvashuk
  • 389
  • 2
  • 15
  • I understand the differences in the Soap Request. I am asking if the WSDL file given indicates whether to use Soap 1.2 or Soap 1.1? It appears that it provides support for both, but I am not sure. – ma77c Sep 06 '17 at 15:19
  • It looks like your question duplicates this one: https://stackoverflow.com/questions/736845/can-a-wsdl-indicate-the-soap-version-1-1-or-1-2-of-the-web-service WSDL supports both versions of soap and furtermore it can support both of them at the same wsdl – Iurii Kvashuk Sep 06 '17 at 15:34
0

ANSWER TO MY OWN QUESTION

WSDL files can indicate support for both SOAP 1.1 and 1.2 in the same file. You can specify which binding you are using with:

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')
ma77c
  • 1,052
  • 14
  • 31