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

I have perl v5.8.5 and SOAP-Lite-0.710.08. Can anybody help me resolving the error that I am getting ? I am getting a error :"SOAP::Serializer::envelope: Client Application failed during request deserialization" while client is trying to call a method on server. ** server code is :
#!/usr/bin/perl -w BEGIN { my $use_lib = "use lib qw[ /usr/lib/perl5/ /usr/lib/perl5/site_per +l/5.8.5/ /usr/lib/perl5/site_perl/5.8.5/SOAP/ ]"; eval $use_lib; } use SOAP::Lite +trace => qw( all ); use SOAP::Transport::HTTP; my $daemon = SOAP::Transport::HTTP::Daemon -> new (LocalAddr=>'localhost', LocalPort=>8001, listen=>5); $daemon -> dispatch_to('Hello::hello'); print "Contact SOAP server at ", $daemon->url, "\n"; $daemon->handle();
Module Hello.pm is :
package Hello; sub hello { shift; return "Hello " . shift; }
Client code is :
#!/usr/bin/perl -w BEGIN { my $use_lib = "use lib qw[ /usr/lib/perl5/ /usr/lib/perl5/site_per +l/5.8.5/ /usr/lib/perl5/site_perl/5.8.5/SOAP/ ]"; eval $use_lib; } use SOAP::Lite +trace => qw( all ); my $client = SOAP::Lite->new(); $client->uri('urn:Hello'); $client->proxy('http://localhost:8001'); my $som = $client->hello("Herong"); my $output = $som->result; print $output . "\n";
Server side say :
SOAP::Deserializer::deserialize: () SOAP::Parser::decode: () SOAP::Serializer::envelope: () Use of uninitialized value in join or string at /usr/lib/perl5/site_pe +rl/5.8.5//SOAP/Lite.pm line 2826. at /usr/lib/perl5/site_perl/5.8.5//SOAP/Lite.pm line 2826 SOAP::Trace::defaultlog('Client', 'Application failed during r +equest deserialization: \x{a}no elemen...', 'undef', 'http://localhos +t.localdomain:8001/') called at /usr/lib/perl5/site_perl/5.8.5//SOAP/ +Lite.pm line 1550 SOAP::Serializer::envelope('SOAP::Serializer=HASH(0x9cd5dd0)', + 'fault', 'Client', 'Application failed during request deserializatio +n: \x{a}no elemen...', 'undef', 'http://localhost.localdomain:8001/') + called at /usr/lib/perl5/site_perl/5.8.5//SOAP/Lite.pm line 746 SOAP::Serializer::__ANON__[/usr/lib/perl5/site_perl/5.8.5//SOA +P/Lite.pm:746]('SOAP::Serializer=HASH(0x9cd5dd0)', 'Client', 'Applica +tion failed during request deserialization: \x{a}no elemen...', 'unde +f', 'http://localhost.localdomain:8001/') called at /usr/lib/perl5/si +te_perl/5.8.5//SOAP/Lite.pm line 2802 SOAP::Server::make_fault('SOAP::Transport::HTTP::Daemon=HASH(0 +x9e7fd8c)', 'Client', '') called at /usr/lib/perl5/site_perl/5.8.5//S +OAP/Transport/HTTP.pm line 399 SOAP::Transport::HTTP::Server::make_fault('SOAP::Transport::HT +TP::Daemon=HASH(0x9e7fd8c)', 'Client', '') called at /usr/lib/perl5/s +ite_perl/5.8.5//SOAP/Lite.pm line 2786 SOAP::Server::handle('SOAP::Transport::HTTP::Daemon=HASH(0x9e7 +fd8c)', '<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:x +s...') called at /usr/lib/perl5/site_perl/5.8.5//SOAP/Transport/HTTP. +pm line 387 SOAP::Transport::HTTP::Server::handle('SOAP::Transport::HTTP:: +Daemon=HASH(0x9e7fd8c)') called at /usr/lib/perl5/site_perl/5.8.5//SO +AP/Transport/HTTP.pm line 600 SOAP::Transport::HTTP::Daemon::handle('SOAP::Transport::HTTP:: +Daemon=HASH(0x9e7fd8c)') called at soapserver.pl line 18 SOAP::Serializer::envelope: Client Application failed during request d +eserialization: no element found at line 1, column 0, byte -1 at /usr/lib/perl5/site_p +erl/5.8.5//i386-linux-thread-multi/XML/Parser.pm line 185 http://localhost.localdomain:8001/
Clien side says:
SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x89da +a44) SOAP::Transport::HTTP::Client::send_receive: POST http://localhost:800 +1 HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 451 Content-Type: text/xml; charset=utf-8 SOAPAction: "urn:Hello#hello" <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http:/ +/www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xm +lsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema +" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmln +s:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><hello +xmlns="urn:Hello"><c-gensym3 xsi:type="xsd:string">Herong</c-gensym3> +</hello></soap:Body></soap:Envelope> SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x8b4 +387c) SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Ser +ver Error Date: Thu, 11 Jun 2009 07:03:27 GMT Server: libwww-perl-daemon/5.826 Content-Length: 692 Content-Type: text/xml; charset=utf-8 Client-Date: Thu, 11 Jun 2009 07:03:27 GMT Client-Peer: 127.0.0.1:8001 Client-Response-Num: 1 SOAPServer: SOAP::Lite/Perl/0.710.07 <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http:/ +/www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xm +lsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema +" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmln +s:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:F +ault><faultcode>soap:Client</faultcode><faultstring>Application faile +d during request deserialization: no element found at line 1, column 0, byte -1 at /usr/lib/perl5/site_p +erl/5.8.5//i386-linux-thread-multi/XML/Parser.pm line 185 </faultstring><faultactor>http://localhost.localdomain:8001/</faultact +or></soap:Fault></soap:Body></soap:Envelope> SOAP::Deserializer::deserialize: ()
Please help me in resolving this if anybody is having a idea. Thanks in advance.

Replies are listed 'Best First'.
Re: SOAP::Serializer::envelope: Client Application failed during request deserialization
by arc_of_descent (Hermit) on Jun 11, 2009 at 16:27 UTC

    Your code works for me with both the folllowing combinations

    1. Perl v5.10.0, SOAP::Lite 0.710.08
    2. Perl v5.8.8, SOAP::Lite 0.69

    Unfortunately, I can't test with any other combinations. One suggestion would be to try a lower version of SOAP::Lite. Why do you need that BEGIN block? You're using the system paths anyway, so try removing that BEGIN block and check.


    --
    Rohan