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

Problems executing HelloWorld webservice...getting use of uninitialized value in concatenation

Expand Messages
  • Mike Klein
    My Perl skills are admittedly near non-existent... I am running on a RH9 system, with Perl version 5.8.0. I purchased the Programming Web Services with Soap
    Message 1 of 2 , Oct 6, 2003
    • 0 Attachment
      My Perl skills are admittedly near non-existent...

      I am running on a RH9 system, with Perl version 5.8.0.

      I purchased the Programming Web Services with Soap book, and am
      attempting the HelloWorld application. It's a no go...output follows:
      ==================================
      [mklein@mother VxAppliance]# ./hw_client.perl mikey
      Calling the SOAP Quotation Server...with name=mikey
      Use of uninitialized value in concatenation (.) or string at
      ./hw_client.perl line 6.
      [mklein@mother VxAppliance]#

      It seems to be bombing inside the SOAP::Lite call...because the cgi
      program isn't returning a string value?

      My apache error log shows the following:

      www.vxappliance.com - - [06/Oct/2003:18:49:23 -0700] "POST
      /cgi-bin/helloworld.cgi HTTP/1.1" 500 662

      The 3 perl programs for this web service follow:
      =========================
      #!/usr/bin/perl -w
      # hw_client.pl - helloworld client
      use SOAP::Lite;
      my $name = shift;
      print "\n\nCalling the SOAP Quotation Server...with name=$name\n\n";
      print SOAP::Lite
      -> uri('urn:Example1')
      -> proxy('http://www.vxappliance.com/cgi-bin/helloworld.cgi')
      -> sayHello($name)
      -> result . "\n\n";
      =========================
      #!/usr/bin/perl -w
      # helloworld.cgi - hello SOAP handler
      use lib '/www/html/VxAppliance'; # This points to where Hello.pm is
      use SOAP::Transport::HTTP;
      SOAP::Transport::HTTP::CGI
      -> dispatch_to('/www/html/VxAppliance', , 'Hello::(?:sayHello)')
      -> handle
      ;
      =========================
      # Hello.pm - Hello server
      package Hello;
      sub sayHello {
      shift;
      return "Hello " . shift;
      }
      1;
      =========================
      I know the helloworld.cgi is executing and permissions for it are okay,
      it seems to be a problem binding to the Hello service implementation. I
      would rather not put test perl code into the perl paths, and I thgouth
      my "use lib" above would be enough to locate the service implementation.

      Any ideas on what I need to get HelloWorld web service running?
      (Geez...a problem with hello world...depressing).
    • Mike Klein
      Problem was sample hello world application in book Programming Web Services with SOAP has an error. print SOAP::Lite - uri( urn:Example1 ) -
      Message 2 of 2 , Oct 8, 2003
      • 0 Attachment
        Problem was sample hello world application in book "Programming Web
        Services with SOAP" has an error.

        print SOAP::Lite
        -> uri('urn:Example1')
        -> proxy('http://www.vxappliance.com/soap/helloworld.cgi')
        -> sayHello($name)
        -> result . "\n\n";

        The uri line should read:

        -> uri('urn:Hello')

        I was able to find this out ONLY by changing a line in hw_client.pl from:

        use SOAP::Lite;

        to

        use SOAP::Lite + 'trace';

        Adding the trace command made it clear that the urn parameter was a
        problem and that is was prepending this value to sayHello, when it was
        really the package name Hello that needed to be prepended.
      Your message has been successfully submitted and would be delivered to recipients shortly.