NYCPHP Meetup

[nycphp-talk] Parsing SOAP Response

Joseph Crawford codebowl at gmail.com
Wed Feb 1 19:14:20 EST 2006


Hello Guys,

I am trying to parse a soap response, but i am having no luck with simpleXML

the response 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:Body><n:getTokenResponse xmlns:n='
http://www.arcwebservices.com/v2006'><n:Result xsi:type='xsd:string'>
bGlja2V0eXNoaXA6MTg5ODA3MWQ=</n:Result></n:getTokenResponse></soap:Body>
</soap:Envelope>

altered a bit ofcourse however when i use SimpleXML like so

$xml = simplexml_load_string($this->response);

i get

 SimpleXMLElement Object
(
    [Body] => SimpleXMLElement Object
        (
            [getTokenResponse] => SimpleXMLElement Object
                (
                    [Result] => bGlja2V0eXNoaXA6MTg5ODA3MWQ=
                )

        )

)

But i cannot seem to get the value for Result no matter what i try
i have tried print_r($xml->children()) nothing is output
i have tried $xml->Body->getTokenResponse->Result nada
i have tried $xml->Body[0]->getTokenResponse->Result
etc.. all the way down to where all 3 are [0]

If anyone has any idea how i can retrieve that value i would appreciate it.

Thanks,

--
Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.
1-802-671-2021
codebowl at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20060201/b91ed114/attachment.html>


More information about the talk mailing list