Loading ...
Sorry, an error occurred while loading the content.

Problem getting full list from complex response

Expand Messages
  • Aaron BRICE
    I m getting a list back from a SOAP server, but the result() only contains the last item in the list. With debug on, I see that the reply is:
    Message 1 of 3 , Oct 18, 2005
    • 0 Attachment
      I'm getting a list back from a SOAP server, but the result() only
      contains the last item in the list. With debug on, I see that the reply is:

      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope ... xmlns:RTD="urn:rtd">
      <SOAP-ENV:Body ...>
      <RTD:getAreas4FaciResponse>
      <pAreasList xsi:type="RTD:ListOfAreas">
      <item xsi:type="RTD:Area">
      <id xsi:type="xsd:string">@ADMIN</id>
      <name xsi:type="xsd:string">@ADMIN</name>
      </item>
      <item xsi:type="RTD:Area">
      <id xsi:type="xsd:string">@CB01</id>
      <name xsi:type="xsd:string">@CB01</name>
      </item>
      ...
      <item xsi:type="RTD:Area">
      <id xsi:type="xsd:string">@XM01</id>
      <name xsi:type="xsd:string">@XM01</name>
      </item>
      </pAreasList>
      </RTD:getAreas4FaciResponse>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

      But when I run Data::Dumper::Simple::Dumper() on $result it shows:

      $result = bless( {
      'item' => bless( {
      'name' => '@XM01',
      'id' => '@XM01'
      }, 'Area' )
      }, 'ListOfAreas' );

      First time using SOAP::Lite, but shouldn't $result->{item} be an array
      reference? How can I access all the elements?

      Thanks,
      Aaron
    • Eric Bridger
      See: http://www.majordojo.com/archives/2003/08/parsing_a_resul.php On Tue, 2005-10-18 at 20:36, Aaron BRICE wrote: I m getting a list back from a SOAP server,
      Message 2 of 3 , Oct 19, 2005
      • 0 Attachment
        See: http://www.majordojo.com/archives/2003/08/parsing_a_resul.php


        On Tue, 2005-10-18 at 20:36, Aaron BRICE wrote: I'm getting a list back
        from a SOAP server, but the result() only
        contains the last item in the list. With debug on, I see that the reply
        is:

        <?xml version="1.0" encoding="UTF-8"?>
        <SOAP-ENV:Envelope ... xmlns:RTD="urn:rtd">
        <SOAP-ENV:Body ...>
        <RTD:getAreas4FaciResponse>
        <pAreasList xsi:type="RTD:ListOfAreas">
        <item xsi:type="RTD:Area">
        <id xsi:type="xsd:string">@ADMIN</id>
        <name xsi:type="xsd:string">@ADMIN</name>
        </item>
        <item xsi:type="RTD:Area">
        <id xsi:type="xsd:string">@CB01</id>
        <name xsi:type="xsd:string">@CB01</name>
        </item>
        ...
        <item xsi:type="RTD:Area">
        <id xsi:type="xsd:string">@XM01</id>
        <name xsi:type="xsd:string">@XM01</name>
        </item>
        </pAreasList>
        </RTD:getAreas4FaciResponse>
        </SOAP-ENV:Body>
        </SOAP-ENV:Envelope>

        But when I run Data::Dumper::Simple::Dumper() on $result it shows:

        $result = bless( {
        'item' => bless( {
        'name' => '@XM01',
        'id' => '@XM01'
        }, 'Area' )
        }, 'ListOfAreas' );

        First time using SOAP::Lite, but shouldn't $result->{item} be an array
        reference? How can I access all the elements?

        Thanks,
        Aaron


        SPONSORED LINKS
        Protocol analyzer
        Ssl protocol
        Protocol converter
        Sip protocol
        Protocol analysis
        Protocol

        ________________________________________________________________________
        YAHOO! GROUPS LINKS

        1. Visit your group "soaplite" on the web.

        2. To unsubscribe from this group, send an email to:
        soaplite-unsubscribe@yahoogroups.com

        3. Your use of Yahoo! Groups is subject to the Yahoo! Terms of
        Service.

        ________________________________________________________________________
      • Aaron BRICE
        ... Thanks, this works. Is this considered a workaround for a SOAP::Lite bug, or is there a good reason that result() doesn t return all of the data?
        Message 3 of 3 , Oct 20, 2005
        • 0 Attachment
          Alex Pena wrote:
          > Try something like this:
          >
          > foreach my $item ($som->valueof("//MethodResponse/*")) {
          > print "$item->{id}\n";
          > print "$item->{name}\n";
          > }
          >

          Thanks, this works. Is this considered a workaround for a SOAP::Lite
          bug, or is there a good reason that result() doesn't return all of the data?
        Your message has been successfully submitted and would be delivered to recipients shortly.