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

SOAP::Lite server error..?

Expand Messages
  • show2sh
    Hi All, I ve installed SOAP::Lite and tried to test the sample. The client throws exception the following exception when exception: not well-formed (invalid
    Message 1 of 2 , Mar 10, 2005
    • 0 Attachment
      Hi All,

      I've installed SOAP::Lite and tried to test the sample. The client throws
      exception the following exception when exception:

      not well-formed (invalid token) at line 1, column 1, byte 1 at
      /usr/local/lib/perl5/site_perl/5.8.6/i686-linux/XML/Parser.pm line 187
      #!/usr/bin/env perl5.8.6

      use SOAP::Transport::HTTP;
      use World;

      SOAP::Transport::HTTP::CGI
      -> dispatch_to('World')
      -> handle;
      at soapClient.pl line 9


      ------

      The following is the code I've tested with:

      World.pm
      --------
      package World;

      sub new {
      bless {}, shift;
      };

      sub HelloWorld {
      my ($self) = @_;

      return "Answer from sub HelloW\n";
      };

      sub GoodByeWorld {
      my ($self,$adjective) = @_;
      return "Goodbye $adjective \n";
      }

      1;

      soapserver.cgi#!/usr/bin/env perl5.8.6

      use SOAP::Transport::HTTP;
      use World;

      SOAP::Transport::HTTP::CGI
      -> dispatch_to('World')
      -> handle;

      soapclient.pl
      --------------
      #!/usr/local/bin/perl
      use SOAP::Lite;
      my $soap = SOAP::Lite
      ->uri('World')
      ->proxy('http://localhost/soap/soapserver.cgi');
      #->on_debug(sub{warn @_});
      $som = $soap->GoodBye("Bad world");
      if ( $som->fault ) {
      warn $som->faultcode() ||'', " : ", $som->faultstring()||'',
      " : ",$som->faultdetail()||'',"\n";
      } else {
      print $som->result();
      }


      --------------
      Does anybody know why the error occurs and how to overcome this. Does it
      indicate that the server is not properly serving the XML...?

      The module versions installed are as below:
      SOAP::Lite => 0.60
      XML::Parser => 2.34

      Fedora Core 3/ Apache 2.0.52

      Regards
      --Shobhan

      --
      !!@!!
      Don't be afraid to experiment. The best way to learn stuff is to play with
      it.
    • Duncan Cameron
      ... This is not the name of the method in your server class. Should it be GoodByeWorld? Duncan Send instant messages to your online friends
      Message 2 of 2 , Mar 10, 2005
      • 0 Attachment
        At 2005-03-10, 13:04:52 show2sh <show2sh@...> wrote:

        >Hi All,
        >
        >I've installed SOAP::Lite and tried to test the sample. The client
        >throws
        >exception the following exception when exception:
        >
        >not well-formed (invalid token) at line 1, column 1, byte 1 at
        >/usr/local/lib/perl5/site_perl/5.8.6/i686-linux/XML/Parser.pm line 187
        >#!/usr/bin/env perl5.8.6
        >
        >use SOAP::Transport::HTTP;
        >use World;
        >
        >SOAP::Transport::HTTP::CGI
        > -> dispatch_to('World')
        > -> handle;
        > at soapClient.pl line 9
        >
        >------
        >
        >The following is the code I've tested with:
        >
        >World.pm
        >--------
        >package World;
        >
        >sub new {
        > bless {}, shift;
        >};
        >
        >sub HelloWorld {
        > my ($self) = @_;
        >
        > return "Answer from sub HelloW\n";
        >};
        >
        >sub GoodByeWorld {
        > my ($self,$adjective) = @_;
        > return "Goodbye $adjective \n";
        >}
        >1;
        >
        >soapserver.cgi#!/usr/bin/env perl5.8.6
        >
        >use SOAP::Transport::HTTP;
        >use World;
        >
        >SOAP::Transport::HTTP::CGI
        > -> dispatch_to('World')
        > -> handle;
        >
        >soapclient.pl
        >--------------
        >#!/usr/local/bin/perl
        >use SOAP::Lite;
        >my $soap = SOAP::Lite
        > ->uri('World')
        > ->proxy('http://localhost/soap/soapserver.cgi');
        > #->on_debug(sub{warn @_});
        >$som = $soap->GoodBye("Bad world");

        This is not the name of the method in your server class. Should it be
        GoodByeWorld?

        Duncan




        Send instant messages to your online friends http://uk.messenger.yahoo.com
      Your message has been successfully submitted and would be delivered to recipients shortly.