How can I create the following part as part of a soap request?
<RequestDetails xsi:type="PostcodeRequest">
<Postcode>SW1A 1AA</Postcode>
</RequestDetails>
I am creating the soap request using arrays
$aPostcode = array('Postcode'=>'SW1A 1AA')
$aPostcodeRequest = array('PostcodeRequest' => $aPostcode);
$GetLineCharacteristicsRequest = array('RequestDetails' => aPostcodeRequest);
I didn't find a way to achieve it using arrays, but I could do it with classes. The code:
Will give this as request:
Of course, this is assuming you have a "hola" function in your SOAP server. Replace it with whatever you're calling.
This solution is based in the example of the SoapVar constructor.