Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This is really two questions. When I run the code (Client 1) I get
Can't call method "valueof" on unblessed reference...
And Data:Dumper just shows me the last record, I should get 3.

My questions then are;
1) Why I'm I only getting the last record?
2) Why is $soap different when using the service method?

I'm using version .55


Client 1

#! perl -w use SOAP::Lite +trace => qw(debug); my $soap = SOAP::Lite #->uri("urn:test") #->proxy("http://127.0.0.1/cgi-bin/wambam/services/test_handler.pl") ->service("http://127.0.0.1/htdocs/test.wsdl") ->test_method(); use Data::Dumper; print Dumper($soap); @row = $soap->valueof('//row'); foreach my $thing (@row) { while (my ($key,$value) = each(%$thing)) { if ($value){ print "$key \t=> $value\n"; } } }
Output
$VAR1 = { 'row' => { 'value' => '5.1', 'date' => '1999-01-03 00:00:00.000', 'flag' => undef } };
Client 2
#! perl -w use SOAP::Lite +trace => qw(debug); my $soap = SOAP::Lite ->uri("urn:test") ->proxy("http://127.0.0.1/cgi-bin/wambam/services/test_handler.pl") #->service("http://127.0.0.1/htdocs/test.wsdl") ->test_method(); use Data::Dumper; print Dumper($soap); @row = $soap->valueof('//row'); foreach my $thing (@row) { while (my ($key,$value) = each(%$thing)) { if ($value){ print "$key \t=> $value\n"; } } }
Output Data::Dumper output removed
value => 7.3 date => 1999-01-01 00:00:00.000 value => 4.6 date => 1999-01-02 00:00:00.000 value => 5.1 date => 1999-01-03 00:00:00.000

soap
<test_methodd> <row> <date xsi:type="xsd:string">1999-01-0100:00:00.000</date> <value xsi:type="xsd:string">7.3</value> <flag xsi:type="xsd:string" xsi:null="1"/> </row> <row> <date xsi:type="xsd:string">1999-01-0200:00:00.000</date> <value xsi:type="xsd:string">4.6</value> <flag xsi:type="xsd:string" xsi:null="1"/> </row> <row> <date xsi:type="xsd:string">1999-01-0300:00:00.000</date> <value xsi:type="xsd:string">5.1</value> <flag xsi:type="xsd:string" xsi:null="1"/> </row> </test_methodd>