From 3d12c2acf0ba8284271f9d71549c930468b0b17e Mon Sep 17 00:00:00 2001 From: Vitor Leonel Date: Fri, 28 Jul 2017 11:41:50 -0300 Subject: [PATCH] Fix Trying to get property of non-object No have Status on Response object because exists a new object name AWBInfo with this information. --- DHL/Entity/Base.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DHL/Entity/Base.php b/DHL/Entity/Base.php index 7a568b3..25fc3de 100644 --- a/DHL/Entity/Base.php +++ b/DHL/Entity/Base.php @@ -230,9 +230,9 @@ public function initFromXML($xml) { $xml = simplexml_load_string(str_replace('req:', '', $xml)); - if ((string) $xml->Response->Status->Condition->ConditionCode != '') + if ((string) $xml->AWBInfo->Status->Condition->ConditionCode != '') { - $errorMsg = ((string) $xml->Response->Status->Condition->ConditionCode) . ' : ' . ((string) $xml->Response->Status->Condition->ConditionData); + $errorMsg = ((string) $xml->AWBInfo->Status->Condition->ConditionCode) . ' : ' . ((string) $xml->AWBInfo->Status->Condition->ConditionCode); throw new \Exception('Error returned from DHL webservice : ' . $errorMsg); }