PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $response = <<<XML <?xml version='1.0' encoding='UTF-8'?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://webservice/CrsWSApi.wsdl/types/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <env:Body> <ns0:callwsapiResponseElement> <ns0:result> <ns0:object>BTS</ns0:object> <ns0:receiver>BTSV45_ANSF_PROD-AKITT</ns0:receiver> <ns0:sender>ANSFP</ns0:sender> <ns0:data> {"name":"Paolo", "cognome": Rossi, "data":"18/11/1983"} </ns0:data> <ns0:errormess xsi:nil="true"/> <ns0:errorcode xsi:nil="true"/> <ns0:status>1</ns0:status> <ns0:sessionid>akit1</ns0:sessionid> </ns0:result> </ns0:callwsapiResponseElement> </env:Body> </env:Envelope> XML; define('XMLNS_ENV', 'http://schemas.xmlsoap.org/soap/envelope/'); define('XMLNS_NS0', 'http://webservice/CrsWSApi.wsdl/types/'); //$xml = simplexml_load_string($response); $xml = new SimpleXmlElement($response); $xml->registerXPathNamespace('prefix', 'http://webservice/CrsWSApi.wsdl/types/'); $result = $xml->xpath("//ns0:callwsapiResponseElement"); print_r($result);
Show:  
Copy Clear