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>

In reply to WSDL return value only contains last record by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.