Skip to content

Instantly share code, notes, and snippets.

@Buntix
Last active October 19, 2015 11:52
Show Gist options
  • Save Buntix/b02f2126566a566e7648 to your computer and use it in GitHub Desktop.
Save Buntix/b02f2126566a566e7648 to your computer and use it in GitHub Desktop.
Test PHP WSDL fetching.
<?php
require_once basename(__FILE__) . '/../vendor/autoload.php';
$interface = new \RoyalMail\RoyalMail([
'mode' => 'onboarding',
'application_id' => '9876543210',
'transaction_id' => 'order-234',
'username' => 'my-username',
'password' => 'my-password',
'endpoint' => NULL,
'soap_client_options' => [
'uri' => MODULE_ROOT . 'reference/ShippingAPI_V2_0_8.wsdl',
'location' => 'https://api.royalmail.com/shipping/onboarding',
'exception' => FALSE,
'local_cert' => NULL,
],
]);
$response = $interface->cancelShipment(['cancelShipments' => ['RQ221150289GB']]);
print_r($response->getErrors());
if ($response->getDebugInfo()) {
print_r($response->getDebugInfo()->getConfig());
print_r($response->getDebugInfo()->getException()->getMessage());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment