Click here to get back home

Soap::Lite Cant get array of results?

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Soap::Lite Cant get array of results? Lordy 03-30-2005
Posted by Lordy on March 30, 2005, 12:43 am
Please log in for more thread options


I have a web service that returns


<soap:Envelope ...>
<soap:Body>
<myOperationResponse xmlns="nyService">
<myOperationResult>
<Wrapper>
<Customer>customer 1 data</Customer>
<Customer>customer 2 data</Customer>
         ..
<Customer>customer 50 data</Customer>
</wrapper>
</myOperationResult>
</myOperationResponse>
</soap:Body>
</soap:Envelope>


The number of levels of 'wrapper' elements are for intergration reasons
and cannot be reasonably changed during this phase.

However when I query the first example using SOAP::Lite I can only see
the data for Customer 50 in the example above. It is like a hash was
used to hold the low level elements. It is definitely the first and NOT
the last customer element when looking at the raw data coming down the
wire.

Using paramsout() doenst help as paramsout is always undefined.

I'm sure I'm missing something as it seems such a simple problem and not
one I would expect to be a bug in SOAP::Lite. But I'm at a loss!

You will have to excuse my perl, but the function I use to display the
result is as follows:

sub showElem() {
        ( my $indent,my $tag,my $elem ) = @_;

        if ( ref($elem) eq 'ARRAY' ) {
# This clause doesnt get invoked at all
                my $i=0;
                foreach my $item ( @$elem ) {
                        &showElem("$indent ","$tag"."[$i]",$item);
                        $i++;
                }
        } elsif ( ref($elem) eq 'HASH' ) {
                print "n$indent<$tag>n";
                foreach my $key ( keys %$elem ) {
                        my $value = $$elem; #Could something be wrong
here?
                        &showElem("$indent ",$key,$value);
                }
                print "$indent</$tag>n";
        } else {
                print "$indent<$tag>$elem</$tag>n";
        }
        
}

Any ideas why only my last customer element is being shown?

--
Lordy


Posted by Lordy on March 30, 2005, 12:49 am
Please log in for more thread options


216.196.109.145:

> I have a web service that returns
>
>
> <soap:Envelope ...>
> <soap:Body>
> <myOperationResponse xmlns="nyService">
> <myOperationResult>
> <Wrapper>
> <Customer>customer 1 data</Customer>
> <Customer>customer 2 data</Customer>
> ..
> <Customer>customer 50 data</Customer>
> </wrapper>
> </myOperationResult>
> </myOperationResponse>
> </soap:Body>
> </soap:Envelope>
>
>
> The number of levels of 'wrapper' elements are for intergration reasons
> and cannot be reasonably changed during this phase.
>
> However when I query the first example using SOAP::Lite I can only see
> the data for Customer 50 in the example above. It is like a hash was
> used to hold the low level elements. It is definitely the first and NOT
> the last customer element when looking at the raw data coming down the
> wire.
>
> Using paramsout() doenst help as paramsout is always undefined.
> Any ideas why only my last customer element is being shown?
>

Forgot to mention using ActivePerl 5.8.6 [See OP for additional info ]

--
Lordy


Similar ThreadsPosted
SOAP::Lite : Problem of # sign added by SOAP::Lite in the sent SOAPActionstring November 5, 2004, 8:45 pm
SOAP::Lite WSDL method with multiple soap:body parts February 16, 2005, 3:32 pm
Writing a HTML/ASP SOAP client for a SOAP::Lite destination March 16, 2005, 5:19 pm
How to convert ArrayOfstring in SOAP into an array of PERL? July 24, 2007, 3:25 pm
Help with SOAP::Lite January 19, 2005, 11:35 pm
SOAP::Lite March 3, 2005, 6:13 am
Using SOAP::Lite and .NET November 16, 2005, 2:12 pm
SOAP::Lite March 5, 2007, 4:26 am
use SOAP::Lite +autodispatch ??? November 23, 2004, 3:12 am
SOAP::Lite weirdness April 6, 2006, 8:07 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap