From: Balachandran K. <bk...@ho...> - 2006-09-18 13:58:51
|
Guys, i am getting error: soap:Client: Failed to locate method (Echo) in class (main) at /usr/lib/perl5/site_perl/5.8.8/SOAP/Lite.pm line 2586. Any help would be highly appreciated. Echo.pm ( lives in http://www.hostname.com/cgi-bin ) ------------ #!/usr/bin/perl package Echo; sub echo { my ($self, @args) = @_; return join(",", @args); } return 1; echo.cgi ( lives in http://www.hostname.com/cgi-bin) ----------- #!/usr/bin/perl -w use SOAP::Transport::HTTP; require("/var/www/cgi-bin/Echo.pm"); SOAP::Transport::HTTP::CGI ->dispatch_to('http://www.hostname.com/cgi-bin', 'Echo') ->handle; echo_client.pl ( also lives in http://www.hostname.com/cgi-bin ) ------------------- #!/usr/bin/perl -w use SOAP::Lite +trace => 'debug'; $HOST="http://www.hostname.com/cgi-bin/echo.cgi"; $NS = "urn:Echo"; $PHRASE = shift; my $soap = SOAP::Lite ->readable(1) ->uri($NS) ->proxy($HOST); my $som = $soap->echo(SOAP::Data->name("whatToEcho"=>"$PHRASE")); print "The response from the server was:\n".$som->result."\n"; When echo_client.pl is executed from the "hostname" command prompt, it returns the desired string. But when executed through PHP4 ( using NuSOAP), it gives error. That error can be seen by visiting (http://www.apartment-4rent.com/testgeocode.php); PHP Code -------------- <? require_once('./nusoap.php'); $mystring ="I am testing"; $param = array($mystring); $s = new soapclient('http://www.hostname.com/cgi-bin/echo.cgi'); $result = $s->call('Echo',$mystring); print_r($result); ?> Thanks & Regards bala |