Ciao a tutti,
sono due giorni che cerco di parserizzare un xml soap con php ma tutte le prove che ho fatto non mi hanno portato a nessun risultato.
Il tracciato xml è il seguente
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<ns1:loadByTicketResponse xmlns:ns1="http://services.xxxx.it">
<ns1ut>
<city xmlns="http://dataobject.xxxx.it">MILANO</city>
vi risparmio i tag di chiusura.....
Ho provato alcuni esempi trovati sul web che utilizzano simplexml ma non riesco mai ad arrivare ad ottenere il valore di city
Ecco il codice usato:
$contents = file_get_contents('soap.xml');
$xml = simplexml_load_string($contents, NULL, NULL, "http://schemas.xmlsoap.org/soap/envelope/");
$ns = $xml->getNamespaces(true);
$soap = $xml->children($ns['soap']);
$getaddressresponse = $soap->Body->children($ns['ns1']);
Qualche idea/aiuto ????