Re: [SOAP] Help with Soap Client

[email protected] (Roger Roelofs)
Newsgroups php.soap
Message-ID <[email protected]>
Tom,

On 04/19/2009 12:58 PM, EPA WC wrote:
> Now I can get the soap response back with the following code, but my
> new problem is how I can parse out information from returned stdClass
> Object. Originally I thought about using simplexml to get what I need,
> but it didn't work since the returned results are in stdClass Objects.
> I also listed the response I got from this code.
>    
No parsing is required.  That's kind of the point of using the soap 
client.  You get back a php object with all the data you would normaly 
have to parse out of the xml yourself.  For example, to display the 
organization names in a list, you just walk the array

for ( $i=0; $i < count($stresults->Organization); $i++ ) {
     echo 
$stresults->Organization[$i]->OrganizationDescription->OrganizationFormalName;
}

Make sense?

Roger
--
Roger Roelofs
Datacomp Appraisal Services
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.