I have a variable that collects the answer SOAP
of the BBDD
, and I need to analyze its content instead of making another request and consuming time. I'm implementing something like a "cache" and avoiding requests soap
continuous.
My code:
$xml = simplexml_load_string($resultCache['respuesta_xml']);
echo "<textarea>";
print_r($xml);
echo "</textarea>";
The xml
is this:
<?xml version="1.0" encoding="utf-8"?>
<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:Header>
<OutputHeader xmlns="Tras.WS.ExternalGateway">
<ExternalID />
<ProcessID></ProcessID>
<Language>1</Language>
<Version>1</Version>
</OutputHeader>
</soap:Header>
<soap:Body>
<ListadoDisponibilidad xmlns="Tras.WS.ExternalGateway">
<ListadoDisponibilidadResult>
<Journeys xmlns="Tras.WS.Interfaces">
<Journey>
</Journey>
</Journeys>
<Error xmlns="Tras.WS.Interfaces">
<ErrorCode>0</ErrorCode>
<ErrorDescription />
</Error>
</ListadoDisponibilidadResult>
</ListadoDisponibilidad>
</soap:Body>
</soap:Envelope>
But I get this error:
exception 'ErrorException' with message 'simplexml_load_string (): namespace warning: xmlns: URI Tras.WS.ExternalGateway is not absolute '