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