PHP: non è in grado di leggere il valore del sotto nodo xml

Sto chiamando questa soap API con curl e non in grado di leggere correttamente il valore di risposta, quindi puoi per favore guidarmi cosa sto facendo male.

Ecco il mio codice:

$wsdl = "http://xxxx/xxxx/xxxx"; $body = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:par="http://xxxx.com"> <soapenv:Header/> <soapenv:Body> <par:cancelReservationReq> <par:garageID>47</par:garageID> <par:orderNumber>orderNumber168</par:orderNumber> <!--Optional:--> <par:barCode>barCode168</par:barCode> <!--Optional:--> <par:orderTime>2015-11-19T00:30:57.905</par:orderTime> </par:cancelReservationReq> </soapenv:Body> </soapenv:Envelope>'; // initializing cURL with the IPG API URL: $ch = curl_init($wsdl); // setting the request type to POST: curl_setopt($ch, CURLOPT_POST, 1); // setting the content type: curl_setopt($ch, CURLOPT_HTTPHEADER, arrays("Content-Type: text/xml")); // setting the authorization method to BASIC: curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); // filling the request body with your SOAP message: curl_setopt($ch, CURLOPT_POSTFIELDS, $body); // telling cURL to verify the server certificate: curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // telling cURL to return the HTTP response body as operation result // value when calling curl_exec: curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // calling cURL and saving the SOAP response message in a variable which // contains a string like "<SOAP-ENV:Envelope ...>...</SOAP-ENV:Envelope>": $result = curl_exec($ch); // loads the XML $xml = simplexml_load_string($result); $soapenv = $xml->children("http://schemas.xmlsoap.org/soap/envelope/"); $tns = $soapenv->Body->children("http://xxxx.com"); echo "success ".$success = $tns->cancelReservationResp->success; echo "message ".$message = $tns->cancelReservationResp->message; echo "garageID ".$garageID = $tns->cancelReservationResp->reservations->garageID; 

Dati di risposta API:

 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header/> <soapenv:Body xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <tns:cancelReservationResp xmlns:tns="http://xxxx.com"> <tns:success>true</tns:success> <tns:message/> <tns:reservations> <tns:garageID>47</tns:garageID> <tns:barCode>barCode168</tns:barCode> <tns:licensePlate>licensePlate168</tns:licensePlate> <tns:orderNumber/> <tns:used>false</tns:used> <tns:cancelled>true</tns:cancelled> <tns:startTime>2015-11-20 22:53:45.547</tns:startTime> <tns:endTime>2015-11-21 22:53:45.547</tns:endTime> <tns:cancelledTime>2015-11-19 00:51:58.717</tns:cancelledTime> <tns:checkInTime/> <tns:checkOutTime/> <tns:grossPrice>152.6000</tns:grossPrice> <tns:commFee>162.6000</tns:commFee> <tns:customerName>customerName168</tns:customerName> <tns:customerEmail>customerEmail168</tns:customerEmail> <tns:customerPhone>customerPhone168</tns:customerPhone> <tns:vehicleMake>vehicleMake168</tns:vehicleMake> <tns:vehicleModel>vehicleModel68</tns:vehicleModel> <tns:vehicleColor>vehicleColor168</tns:vehicleColor> <tns:reentryAllowed>true</tns:reentryAllowed> </tns:reservations> </tns:cancelReservationResp> </soapenv:Body> </soapenv:Envelope> 

Ricevo questo valore <tns:success>true</tns:success> dalla variabile $success , ma non $garageID nulla dalla variabile $garageID .

Qualche idea sul perché $garageID sta diventando bianco?

Grazie.