在SOAP中访问多个响应

在SOAP中访问多个响应

问题描述:

I just learned soap a month ago and managed to get a reply in PHP. I managed to get a response and parse it but I am stuck with a different response where I get 5 instead of 1. Trying to figure out how to parse it. I'm so used to arrays and all that it's a bit confusing for me

Here is a normal response/reply

$value = $client->GetInmate($parameters);

        $xml = $value->GetInmateResult;

        print "Street: ".$xml->Address->Street;
        print "<br>City: ".$xml->Address->City;
        print "<br>State ".$xml->Address->State;

This works

Now I am trying to do something similar but my same method is not working, here is an image of the structure of the next reply:

http://i.stack.imgur.com/wWFxg.png

As you can see, I'm trying to get the 'Charges (5)' and manage them independently but racking my brain to do so. simplexml_load_string() isn't helping either, doesn't seem to parse them correctly.

Aren't you able to retrieve the result in the loop because it is the same format which i can see in the image attached. If not, then let me know the response which you are getting through this line: $xml = $value->GetInmateResult