[nycphp-talk] Parsing SOAP Response

Joseph Crawford codebowl at
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='' xmlns:xsi='' xmlns:xsd=''><soap:Body><n:getTokenResponse xmlns:n=''><n:Result xsi:type='xsd:string'>

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.


Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.
codebowl at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the talk mailing list