I try to make a request to a .NET WSDL function called GetPeriodicValues. The function requires some params and the problem is that SoapClient creates an incorrect XML.
This PHP-code…
$client = new SoapClient(self::URL , array('trace' => 1, 'encoding' => 'UTF-8', 'soap_version' => SOAP_1_1));
$params = array('name' => 'myname', 'address' => 'myaddress');
$result = $client->__soapCall('GetPeriodicValues', array('parameters' => $params), array());
…genereates the following request-XML (I have excluded some irrelevant content):
<SOAP-ENV:Body>
<ns1:RequestOf_GetPeriodicValuesParameters/>
</SOAP-ENV:Body>
But I would expect it to create this
<SOAP-ENV:Body>
<ns1:RequestOf_GetPeriodicValuesParameters>
<ns1:name>myname</ns1:name>
<ns1:address>myaddress</ns1:address>
</ns1:RequestOf_GetPeriodicValuesParameters>
</SOAP-ENV:Body>
How should i include the params in the function-call?
Problem solved. What I learned was that the XML-output is dependent on the WSDL and in my case it wanted me to put params in an array with the key “Params”. However, looking at the XML return by the WSDL I found no such information, instead it looked like the key “parameters” should be used. I’m not sure, but perhaps something was wrong with the service.