Search code examples
phpweb-servicessoapwsdlsoap-client

Does this WSDL support Soap 1.1 AND Soap1.2?


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'


Solution

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