reading of soap xml response by xpath

xml response:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
   <SOAP-ENV:Body SOAP-ENC:encodingStyle="http://schemas.xmlsoap.org/soap/envelope/">
      <NS1:IsWorkingResponse xmlns:NS1="urn:MobileCommIntf-IMobileComm">
         <return xsi:type="xsd:boolean">true</return>
      </NS1:IsWorkingResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

php code :

$xml = simplexml_load_string($output);

$xml->registerXPathNamespace('SOAP-ENV', 'http://schemas.xmlsoap.org/soap/envelope/');
$xml->registerXPathNamespace('NS', 'urn:MobileCommIntf-IMobileComm');
$nodes = $xml->xpath('//SOAP-ENV:Envelope/SOAP-ENV:Body/NS:IsWorkingResponse/return');
print_r($nodes[0]->asXML());

 

http://stackoverflow.com/questions/3928350/how-to-parse-soap-response-without-soapclient

 

Advertisements

About rahul23134654

Hi, I am Rahul Meha , B.E. in (I.T.)
This entry was posted in PHP. Bookmark the permalink.

2 Responses to reading of soap xml response by xpath

  1. natural says:

    I’d like to find out more? I’d want to find
    out more details.

  2. You can send me ur xml , i can help you, i am also looking for some work , if you can provide me ..pls help in it if u can …

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s