So I am tring to connect to a third party service and having some issues with it in PHP. When I try the service request in WebService Studio it works fine and the sent request looks like this:
<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<createUser xmlns="http://ws.example.com">
<arg0 xmlns="">test@test.com</arg0>
<arg1 xmlns="">123</arg1>
<arg2 xmlns="">1234</arg2>
<arg3 xmlns="">1234567890abcdef</arg3>
<arg4 xmlns="">test</arg4>
<arg5 xmlns="">user</arg5>
<arg6 xmlns="">02472</arg6>
<arg7 xmlns="">test@test.com</arg7>
<arg8 xmlns="">A</arg8>
<arg9 xmlns="">0</arg9>
<arg10 xmlns="">true</arg10>
</createUser>
</soap:Body>
</soap:Envelope>
Now when I try to call the service from PHP with the following command:
$this->web_service->createAccount('test@test.com', 123, 1234, '1234567890abcdef', 'test', 'user', '12345', 'test@test.com', 'A', 0, true)
and debugging the request, I get this:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://ws.example.com">
<SOAP-ENV:Body>
<ns1:createUser/>
<param1>123</param1>
<param2>1234</param2>
<param3>1234567890abdcef</param3>
<param4>test</param4>
<param5>user</param5>
<param6>12345</param6>
<param7>test@test.com</param7>
<param8>A</param8>
<param9>0</param9>
<param10>true</param10>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
A few things jump out at me right away with the request generated by SoapClient in PHP. The first thing is that the first parameter (the first time I pass test@test.com) is not being passed in param1, the second parameter is. The next thing is the the request to createUser is a self closing tag not including the parameters being pass. Then obviously the whole structure is a little different with the tag being used.
I have tried using an array (which doesn't even go to the point of throwing the request), wrapping the params in SoapParam, using __call(), and using __soapCall() but none of those fix this issue.
Anyone know what might fix this issue so the request generated by SoapClient in PHP matches the one generated by WebService Studio short of manually generate the soap request by hand?