I have been trying to parse the below soap response without any joy. I have tried going down the xpath way and now using simplexml_load_string without any joy.
here is my soap response:
but my below code does nothing:PHP Code:<envelope:Envelope xmlns:envelope="http://schemas.xmlsoap.org/soap/envelope/"> <envelope:Header></envelope:Header> <envelope:Body xmlns="SilverpopApi:EngageService.SessionMgmt.Login"> <RESULT xmlns="SilverpopApi:EngageService.SessionMgmt.Login" xmlns:envelope="http://schemas.xmlsoap.org/soap/envelope/"> <SUCCESS>true</SUCCESS> <SESSIONID>F9BA7881819F391EE478ACF9328F6EB5</SESSIONID> <ORGANIZATION_ID>134be9-12c81c26df6-4f4749e15ce6d7a21b02ab08b9b7921c</ORGANIZATION_ID> <SESSION_ENCODING>;jsessionid=F9BA7881819F391EE478ACF9328F6EB5</SESSION_ENCODING> </RESULT> </envelope:Body> </envelope:Envelope>
can anyone correct me.PHP Code:$soaoresponce = $client->__getLastResponse();
//echo $soaoresponce->SESSIONID;
//echo htmlentities($soaoresponce);
$strSessionID = simplexml_load_string($soaoresponce);
foreach($strSessionID as $key){
//echo $key;
echo $key->RESULT[1]->SUCCESS;
}




Bookmarks