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

Greetings oh wise ones... I am trying to create and call a web service with perl using SOAP but am not having any luck getting any of the examples to work. I can run the client.pl but it prints nothing. Sample of the code is below and any help would be greatly appreciated. I am running this on an IIS 5 Windowz server using perl version 5.10.0
####Client.pl#### #!perl -w use SOAP::Lite; print SOAP::Lite -> uri('http://localhost/Echo') + -> proxy('http://localhost/scripts/Server.cgi') -> hi() -> result; ####Server.cgi#### #!perl -w use SOAP::Transport::HTTP; SOAP::Transport::HTTP::CGI -> dispatch_to('Echo') -> handle; package Echo; sub hi { return "hello, world"; } sub bye { return "goodbye, cruel world"; }

Replies are listed 'Best First'.
Re: Perl Web Service Returns Nothing
by Perlbotics (Archbishop) on Aug 10, 2011 at 16:56 UTC

    Works for me (Linux, Perl 5.10.0, lighttpd, SOAP::Transport::HTTP 0.710.08)

    The Server.cgi script needs to be run by your local webserver. Please perform the usual checks:

    • Examine webserver logs.
    • Server.cgi can be executed by webserver (permissions, *.cgi registered, path: scripts/ exists and is enabled to run CGI scripts, ...).
    • Pointing your browser to http://localhost/scripts/Server.cgi returns plausible result.
    • instead of #!perl -w, use absolute path to your perl installation.
    • Specify webserver port in proxy(...) (see client) if your webserver uses a non-standard port.
    • ...
    HTH