Loading ...
Sorry, an error occurred while loading the content.

This internet example of SOAP::Lite is not working -- Please help!

Expand Messages
  • mikeburdickutah
    Here is a soap example of a perl script using SOAP::Light I got off the internet. I cannot get it to work, so what is wrong with it or is it something I m
    Message 1 of 1 , Oct 12, 2005
    • 0 Attachment
      Here is a soap example of a perl script using SOAP::Light I got off
      the internet. I cannot get it to work, so what is wrong with it or is
      it something I'm doing?

      Here's the code:

      File Hello.pm

      # Hello.pm - simple Hello module
      package Hello;
      sub sayHello {
      shift; # remove class name
      return "Hello " . shift;
      }
      1;

      File Hello.cgi

      #!/usr/bin/perl -w
      # hello.cgi - Hello SOAP handler
      use SOAP::Transport::HTTP;
      SOAP::Transport::HTTP::CGI
      -> dispatch_to('Hello::(?:sayHello)')
      -> handle
      ;

      File hw_client.pl

      #!/usr/bin/perl -w
      # hw_client.pl - Hello client
      use SOAP::Lite;
      my $name = shift;
      print "\n\nCalling the SOAP Server to say hello\n\n";
      print "The SOAP Server says: ";
      print SOAP::Lite
      -> uri('urn:Example1')
      -> proxy('http://localhost/cgi-bin/helloworld.cgi')
      -> sayHello($name)
      -> result . "\n\n";

      I uploaded the file Hello.pm to my server and put it in a director
      called /cgi-bin/lib

      Then I added the following line to the file hello.cgi:

      use lib `/cgi-bin/lib';

      What am I doing wrong?

      I would appreciate your help. This is so frustrating!

      -Mike
    Your message has been successfully submitted and would be delivered to recipients shortly.