try {
$resp = $client->__soapCall("shipmentTracking", array('shipmentTracking'=>array("search" => $request)));
return $resp;
} catch (SoapFault $ex) {
$responseXML = ($client->__getLastResponse());
return $responseXML;
}
When I print this responseXML, I see a string result on the page, but view source shows me the XML. However, when I did gettype() on it, it shows type as "string". I want to parse the response and extract data out of it. I dont understand how can I do that if I dont have an XML format?
XML Response -
"<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ser-root:shipmentTrackingResponse xmlns:ser-root="https://api.estes-express.com/ws/tools/shipment/tracking/v1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><trackingInfo><requestID>1</requestID><shipments><shipments><pro>1760369125</pro><bol>502260371</bol><po>00847007086241</po><pickupDate>2020-10-23</pickupDate><status>Delivered</status><eventTimeStamp>2020-10-27T17:05:00-0400 </eventTimeStamp><movementHistory> </movementHistory><estimatedDeliveryDate>2020-10-27</estimatedDeliveryDate><estimatedDeliveryTime>12:05:00</estimatedDeliveryTime><receivedBy>JAMISON</receivedBy><appointment><apptDate></apptDate><apptTime></apptTime><status> </status></appointment><pieces>1</pieces><dimensionalWeight></dimensionalWeight><weight>707</weight><shipper><referenceNumber></referenceNumber><name>DAE LEE</name><address><line1>33 JULIA LANE</line1><line2></line2><city>EAST NORTHPORT</city><stateProvince>NY</stateProvince><postalCode>11731</postalCode><countryCode></countryCode></address></shipper><consignee><referenceNumber></referenceNumber><name>YARDISTRY - SONWIL</name><address><line1>1289 WALDEN AVE</line1><line2></line2><city>BUFFALO</city><stateProvince>NY</stateProvince><postalCode>14211</postalCode><countryCode></countryCode></address></consignee><thirdParty><referenceNumber></referenceNumber><name></name><address><line1></line1><line2></line2><city></city><stateProvince></stateProvince><postalCode></postalCode><countryCode> </countryCode></address></thirdParty><destinationTerminal><number>083</number><name>BNY </name><address><line1>3680 Jeffrey Boulevard</line1><line2> </line2><city>Blasdell</city><stateProvince>NY</stateProvince><postalCode>14219</postalCode><countryCode> </countryCode></address><phone><country></country><areaCode>716</areaCode><subscriber>8260963</subscriber><extenstion> </extenstion></phone><fax><areaCode>716</areaCode><subscriber>8241409</subscriber></fax></destinationTerminal><interlineInfo><scac></scac><name></name><type></type></interlineInfo><freightCharges>319.08</freightCharges><messages><message>Freight Charges are shown on shipments for which the logged in user is the payor of the freight charges.</message><message>Freight Charges are subject to change upon audit.</message><message>Reported delivery time is subject to change based upon verification.</message><message></message></messages></shipments></shipments></trackingInfo></ser-root:shipmentTrackingResponse></soapenv:Body></soapenv:Envelope>"