I am using the Royal Mail Shipping API to generate printed PDF labels, my PHP SoapClient returns a valid response shown below (only shown the initial response as the whole respo
Sorted - been a very long day.
I didn't need to decode the response in the end so the following will work (hopefully it helps someone else doing the API integration)
function PrintLabelRequest($shipmentNumber, $transactionId)
{
$rm = new RoyalMailLabelRequest();
// function from library returns a response using SOAP
$response = $rm->PrintLabel($shipmentNumber, $transactionId);
// name the file & saved this label as a PDF in the following folder
$filename = 'printedlabel-' . $shipmentNumber;
file_put_contents(dirname(__FILE__) . '/labels/'. $filename .'.pdf', $response);
}