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

Hi All, I'm running tomcat with Axis and I have a webservise that returns a md5 hash. I hava a simple cgi script that uses SOAP::Lite and it works from the command line,but if I access it via the webserver url or using AJAX I get nothing. here is an example of my soap client:
#!perl use SOAP::Lite; $soap_response = SOAP::Lite -> uri('http://www.soaplite.com/Demo') + -> proxy('http://services.soaplite.com/hibye.cgi') -> getmd5hash("test"); @res = $soap_response->paramsout; $res = $soap_response->result; print "Content-type: text/html\n\n"; print "Result is $res, outparams are @res\n";
thanks

Replies are listed 'Best First'.
Re: Access Web service via CGI
by olus (Curate) on Dec 20, 2007 at 15:18 UTC
    Hi fall95_3

    I ran your code, after adding use strict and warnings, from the command line, and it did not print anything.
    So I initialized SOAP::Lite with trace enabled and I could that the call failed with the mesage:
    Failed to locate method (getmd5hash) in class (Demo) at /home/soaplite +/lib/SOAP/Lite.pm line 2195.
    This is the code I used. You can look at the SOAP messages by running it from the command line.
    #!/usr/bin/perl -w use strict; use SOAP::Lite +trace=>qw{method trace debug}; my $soap_response = SOAP::Lite -> uri('http://www.soaplite.com/Demo') -> proxy('http://services.soaplite.com/hibye.cgi') -> getmd5hash("test"); my @out = $soap_response->paramsout; my $res = $soap_response->result; print "Content-type: text/html\n\n"; print "Result is $res, outparams are @out\n";