NYCPHP Meetup

NYPHP.org

[nycphp-talk] Parsing SOAP Response

Adam Maccabee Trachtenberg adam at trachtenberg.com
Wed Feb 1 19:27:54 EST 2006


On Wed, 1 Feb 2006, Joseph Crawford wrote:

> 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]

Welcome to XML Namespaces. :)

$xml->children('http://schemas.xmlsoap.org/soap/envelope/')->Body
    ->children('http://www.arcwebservices.com/v2006')->getTokenResponse->Result;

This is why the ext/soap extension is good for parsing SOAP documents.

-adam

-- 
adam at trachtenberg.com | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!



More information about the talk mailing list