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

error running a very simple soap client/server

Expand Messages
  • hendra_haliman <halimanh@iprimus.com.au>
    below is the module =================== # Hello.pm - simple Hello module package Hello; sub sayHello { shift; # remove class name return Hello . shift; }
    Message 1 of 1 , Dec 12, 2002
    • 0 Attachment
      below is the module
      ===================
      # Hello.pm - simple Hello module
      package Hello;
      sub sayHello {
      shift; # remove class name
      return "Hello " . shift;
      }
      1;

      below is the SOAP server
      ==========================
      #!/usr/bin/perl -w
      # helloworld.cgi - Hello SOAP handler
      use SOAP::Transport::HTTP;
      use lib '/usr/local/apache/cgi-bin';
      SOAP::Transport::HTTP::CGI
      -> dispatch_to('Hello::(?:sayHello)')
      -> handle
      ;

      below is the client
      ===================
      #!/usr/bin/perl -w
      # HelloworldClient.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:test')
      -> proxy('http://localhost/cgi-bin/Helloworld.cgi')
      -> sayHello($name)
      -> result . "\n\n";

      when I try to run using
      perl HelloworldClient.pl james

      it gives me the error as below:


      below is the error (using +trace)
      =================================
      Unquoted string "trace" may clash with future reserved word at
      HelloworldClient.pl line 2.

      Calling SOAP server
      SOAP::Transport::new: ()
      SOAP::Serializer::new: ()
      SOAP::Deserializer::new: ()
      SOAP::Parser::new: ()
      SOAP::Lite::new: ()
      SOAP::Transport::HTTP::Client::new: ()
      SOAP::Lite::call: ()
      SOAP::Serializer::envelope: ()
      SOAP::Serializer::envelope: sayHello james
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH
      (0x836a40c)
      SOAP::Transport::HTTP::Client::send_receive: POST
      http://localhost/cgi-bin/Helloworld.cgi
      Accept: text/xml
      Accept: multipart/*
      Content-Length: 504
      Content-Type: text/xml; charset=utf-8
      SOAPAction: "urn:test#sayHello"

      <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-
      ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-
      ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-
      ENV:Body><namesp1:sayHello xmlns:namesp1="urn:test"><c-gensym3
      xsi:type="xsd:string">james</c-gensym3></namesp1:sayHello></SOAP-
      ENV:Body></SOAP-ENV:Envelope>
      SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH
      (0x84cf9ac)
      SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal
      Server Error
      Connection: close
      Date: Thu, 12 Dec 2002 10:09:06 GMT
      Server: Apache/1.3.20 (Unix) AxKit/1.6 mod_perl/1.27
      Content-Length: 632
      Content-Type: text/xml; charset=utf-8
      Client-Date: Thu, 12 Dec 2002 10:09:07 GMT
      Client-Response-Num: 1
      SOAPServer: SOAP::Lite/Perl/0.55

      <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-
      ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-
      ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-ENV:Body><SOAP-
      ENV:Fault><faultcode xsi:type="xsd:string">SOAP-
      ENV:Client</faultcode><faultstring xsi:type="xsd:string">Failed to
      access class (test): Can't locate test.pm in @INC (@INC contains:) at
      (eval 90) line 3.
      </faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
      SOAP::Deserializer::deserialize: ()
      SOAP::Parser::decode: ()
      SOAP::SOM::new: ()
      Use of uninitialized value in concatenation (.) at
      HelloworldClient.pl line 5.

      SOAP::Lite::DESTROY: ()
      SOAP::Transport::DESTROY: ()
      SOAP::Transport::HTTP::Client::DESTROY: ()
      SOAP::SOM::DESTROY: ()
      SOAP::Deserializer::DESTROY: ()
      SOAP::Parser::DESTROY: ()
      SOAP::Serializer::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()



      ========================================
      it seems like trying to resolve the uri?
    Your message has been successfully submitted and would be delivered to recipients shortly.