We have an WSDL that contains the following and make a call using the standard SOAP Client of PHP:
<element name="doSomething">
<complexType>
<sequence>
<element name="Payload" nillable="true" type="xsd:string"/>
<element name="Username" type="string"/>
<element name="service" type="string"/>
<element name="Password" type="string"/>
</sequence>
</complexType>
</element>
The Payload is essentially XML data, which looks for example like this
<code>1</code>
Now the request of the SOAP client, dumped via echo $client->__getLastRequest();
looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="pa/WebshopService"><SOAP-ENV:Body><ns1:doSomething><ns1:Payload><code>
1
</code>
</ns1:pcRequest><ns1:Username>bar</ns1:Username><ns1:service>bar</ns1:service><ns1:Password>bar</ns1:Password></ns1:doSomething></SOAP-ENV:Body></SOAP-ENV:Envelope>
which, I believe makes sense, as the <
and >
should be encoded.
The counterpart seems to expect something like this:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="pa/WebshopService"><SOAP-ENV:Body><ns1:doSomething><ns1:Payload><code>
1
</code>
</ns1:pcRequest><ns1:Username>bar</ns1:Username><ns1:service>bar</ns1:service><ns1:Password>bar</ns1:Password></ns1:doSomething></SOAP-ENV:Body></SOAP-ENV:Envelope>
- How can I send such using the PHP SoapClient?
- Is the WSDL even valid in this case?