Jump to content

AeroProDrive

New Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by AeroProDrive

  1. Hi Guys, I have this SOAP message to be parsed using SimpleXML: <soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:body> <isokresponse xmlns="http://tempuri.org/"> <isokresult>1</isokresult> </isokresponse> </soap:body> </soap:envelope> Then I load the XML: $xml = simplexml_load_string($result); I assume I need to register namespace e.g. $xml->registerXPathNamespace("soap","http://schemas.xmlsoap.org/soap/envelope/"); But what's next? How do I get the value of the element isokresult? Thank you so much
  2. I think I found the problem. The @result is of bool type while I was expecting the string from the xml Therefore I changed return $result; to return $result === true ? "true" : "false"; Now it works like a charm Thank you so much
  3. Hello guys, What I do is consuming SOAP Web Service that returns XML data as follows: <?xml version="1.0" encoding="utf-8"?> <string xmlns="http://tempuri.org/">false</string> Unfortunately the curl returns something that I can't parse to XML and get the value "false" My PHP code is the following: $soap_do = curl_init(); curl_setopt($soap_do, CURLOPT_URL, $url ); curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true ); curl_setopt($soap_do, CURLOPT_POST, true ); curl_setopt($soap_do, CURLOPT_POSTFIELDS, $soap_request); curl_setopt($soap_do, CURLOPT_HTTPHEADER, $header); curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false); $result = curl_exec($soap_do); $xml = simplexml_load_string($result); return $xml; How do I parse this SOAP response? Thank you very much
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.