I have a soap request and I need to parse it and get the Uri from posted XML file
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<q1:login xmlns:q1="THE NAMESPACE I NEED">
<user xsi:type="xsd:string">user</user>
<password xsi:type="xsd:string">pass</password>
</q1:login>
</soap:Body>
</soap:Envelope>
I load the xml with SimpleXMLElement, I get the <soap:Body
element (in $body_node) BUT I can't get it's children (to get it's namespace).
the $body_node->asXML();
returns:
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<q1:login xmlns:q1="THE NAMESPACE I NEED">
<user xsi:type="xsd:string">user</user>
<password xsi:type="xsd:string">pass</password>
</q1:login>
</soap:Body>
the $body_node->count() return 0;
and $body_node->children()->asXML() returns false
.
How can I get the login element and it's namespace?