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