Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: SOAP::Lite returning strange value

by shonorio (Hermit)
on Apr 28, 2004 at 14:23 UTC ( [id://348839]=note: print w/replies, xml ) Need Help??


in reply to SOAP::Lite returning strange value

Looking at google, I found on dbForum on problem like this, where was recomended to change the return code.

The new code recomended will look like:

# The package demo ! package Demo; use subs qw( Sub1 Sub2 ); sub Sub1 { my %Test= ( 'Test01' => 1, 'Test02' => 1, 'Test99' => 1 ); return ( 1, \%Test ); # return changed } sub Sub2 { my @Test = ( qw (2 3 4 5 6 7 8 9 10) ); # return changed return (1, \@Test); } 1; # New Client !!!! # Client side use SOAP::Lite; use Data::Dumper; my $endpoint = shift || 'http://localhost:8080'; my $soap = SOAP::Lite->uri('urn:Demo') ->proxy($endpoint); my ( %Test01, @Test02 ); if ( $soap->Sub1()->result ) # First get 1 { %Test01 = %{$soap->Sub1()->paramsout}; # and then hash } if ( $soap->Sub2()->result ) # First get 1 { @Test02 = @{$soap->Sub2()->paramsout}; # and then array } print Dumper ( \%Test01 ); print Dumper ( \@Test02 );
Now i'd like know your opinion if it's the best way to implement one Web Service.

Thanks,

Solli Moreira Honorio
Sao Paulo - Brazil

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://348839]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-19 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found