I am learning to perform webservice with SOAP
and for this I used the library nusoap
.
Everything is correct, the only problem is that I do not know how to deal with the xml once I get it, because it has a format like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 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>
<ns1:Service.getViajesResponse xmlns:ns1="http://tempuri.org">
<return xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="unnamed_struct_use_soapval[9]">
<item>
<title>Titulo</title>
<img>Imagen</img>
</item>
<item>
<title>Titulo</title>
<img>Imagen</img>
</item>
The code that I have in the client to read it is:
private function _soapResponse($result)
{
$xmlResponse = $this->_soapClient->responseData;
print_r($xmlResponse);
}
The print_r()
shows the xml that I have indicated above.
How can I read it to save it in a array
???