Skip to content

Instantly share code, notes, and snippets.

@tim-cotten
Created March 5, 2021 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tim-cotten/be78fdfd23c2ac6155addb4cf1a229df to your computer and use it in GitHub Desktop.
Save tim-cotten/be78fdfd23c2ac6155addb4cf1a229df to your computer and use it in GitHub Desktop.
PHP Bugs: Property Problems (Example B)
<?php
try
{
$response = $client->track($request);
if ($response->HighestSeverity != 'FAILURE' && $response->HighestSeverity != 'ERROR')
{
if (isset($response->TrackDetails)) {
$return[0] = $response->TrackDetails->StatusCode;
$return[1] = $response->TrackDetails->StatusDescription;
} else {
throw new Exception('Missing TrackDetails');
}
echo $response->TrackDetails->StatusCode." -- ".$response->TrackDetails->StatusDescription;
}
else
{
printError($client, $response);
return "print error $refnum";
}
} catch (SoapFault $exception) {
printFault($exception, $client);
return "print fault $refnum";
}
return $return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment