1

This is my SOAP response:

<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://localhost:8000/soap/index.php?wsdl" 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:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:testMethodResponse> <return xsi:type="xsd:boolean">true</return> </ns1:testMethodResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> 

I'd like to return the true. How can I do this?

This is what I'm trying:

$xml = simplexml_load_string($res, NULL, NULL, "http://schemas.xmlsoap.org/soap/envelope/"); $ns = $xml->getNamespaces(true); $soap = $xml->children($ns['SOAP-ENV']); $res = $soap->Body->children($ns['ns1']); foreach ($res->TestMethodResponse as $item) { echo $item->result.PHP_EOL; } 
1
  • PHP has a soap extension, too: php.net/soap Commented Jan 16, 2017 at 16:41

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.