I've come across a problem that I cannot figure out how to fix. I've created a soap client in php that is supposed to do an xml request to a web service - the service is working through SoapUI, but whenever I send the same request through my php client I get the following faultcode:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>**soapenv:VersionMismatch**</faultcode>
<faultstring>**Transport level information does not match with SOAP Message namespace URI**</faultstring>
<detail></detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Now, both the client and the service are working with soap version 1.2, I believe that the problem is in the client, so here it is how I've defined it:
$options = array(
'trace' => true,
'exceptions' => 1,
'style' => SOAP_DOCUMENT,
'use' => SOAP_LITERAL,
'soap_version' => SOAP_1_2,
);
$client = new SoapClient("location_of_the_wsdl", $options);
In the request I'm using the following code:
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:soapenc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header/>
<env:Body>
<ns2:FunctionName xmlns:ns2="namespace_of_the_service">
<arg0>
<data1>?</data1>
</arg0>
</ns2:FunctionName>
</env:Body>
</env:Envelope>
In soapUI this is giving me a 'false' result as the data1 is left with ?, when I write in valid data it returns true.
I've also noticed that in soapUI I'm sending and receiving the Content-type application/soap+xml
, but when I'm doing it through the PHP client I send and receive headers with Content-Type text/xml
;
What could be the problem? I use nusoap.php
for the client.