Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Help with SOAP::Lite error

by Anonymous Monk
on Dec 11, 2012 at 02:11 UTC ( #1008208=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I am trying to get a SOAP::Lite client/server working but keep getting this error on the client side when using autodispatch (Not a HASH reference at C:/Perl/site/lib/SOAP/Lite.pm line 3828.) with SOAP::Lite version 0.712 or higher. With the older version 0.60a of this module the code seems to work as expected.

Martin Kutter (the author of this module) conveyed that I could be missing an API, which I am still not sure of as I went through all the documentation. Can you please help review this and point out the error? Thanks

############## Server ############## #!perl -w use strict; use warnings; use SOAP::Lite +trace => 'all'; use SOAP::Transport::HTTP; my $daemon = SOAP::Transport::HTTP::Daemon->new( LocalAddr => 'localhost', LocalPort => 8001, listen => 5 ); $daemon->dispatch_to('Hello'); print "Contact SOAP server at ", $daemon->url, "\n"; $daemon->handle(); package Hello; sub new { my $class = shift; my $self = { TEXT => "ABC", @_, }; bless $self, $class; return $self; } sub getText { my ($self, $arg) = @_; return $self->{TEXT}; } 1; ############## Client ############## #!perl -w use strict; use warnings; use SOAP::Lite +autodispatch => on_fault => sub { my ($soap, $res) = @_; print ref $res ? $res->faultstring : $soap->transport->status, + "\n"; return "SOAP_TRANSPORT_ERROR"; }, #trace => 'all', ; my $uri = "http://localhost/Hello"; my $proxy = "http://localhost:8001/server.pl"; SOAP::Lite->self->uri($uri)->proxy($proxy); my $h = Hello->new(); my $output = $h->getText(); print $output . "\n";

Comment on Help with SOAP::Lite error
Download Code
Re: Help with SOAP::Lite error
by Anonymous Monk on Dec 11, 2012 at 04:59 UTC

    Martin Kutter (the author of this module) conveyed that I could be missing an API, which I am still not sure of as I went through all the documentation. Can you please help review this and point out the error? Thanks

    He said what?

    If you change that line in SOAP.pm to  ? (%{$_[$param]} = eval{%$$value}||%$value)

    Then you won't get the error, but whether that is the correct thing, I have no idea (if it is , then surely other parts need patching)

      He suggested that I might not be using an API correctly but I don't know what it is. I looked at the 0.60a version and created a patch and sent it to the author to get it reviewed and I wasn't sure if I am breaking something else. Here are the changes, please help review and bless them :)

      diff C:/Perl/site/lib/SOAP/Lite_0.715.pm C:/Perl/site/lib/SOAP/Lite.p +m 1964,1973c1964 < if ( defined o_child($node) ) { < my @children; < foreach my $child ( @{ o_child($node) } ) { < push( @children, $self->_as_data($child) ); < } < $data->set_value( \SOAP::Data->value(@children) ); < } < else { < $data->set_value( o_value($node) ); < } --- > $data->set_value( o_value($node) ); 1993c1984 < die "Incorrect parameter" unless $itself =~/^\d$/; --- > die "Incorrect parameter" unless $itself =~ /^\d*$/;

        He suggested that I might not be using an API correctly but I don't know what it is

        He suggested what?

        See, I can repeat myself also :)

        Here are the changes, please help review and bless them :)

        No thanks, I hate SOAP (especially ancient SOAP), autoload and autodispatch, and isolated patches without tests for modules I don't maintain -- I'm not qualified

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1008208]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (14)
As of 2014-08-27 13:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (238 votes), past polls