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

hibye demo - not well-formed (invalid token) error

Expand Messages
  • jwalsh999
    Brand new SOAP::Lite user here. I am trying to get the hibye demo working locally on my laptop running Ubuntu Ultimate 7.10. The hibye.pl script works when
    Message 1 of 1 , Feb 8 8:24 PM
    • 0 Attachment
      Brand new SOAP::Lite user here. I am trying to get the hibye demo
      working locally on my laptop running Ubuntu Ultimate 7.10.

      The hibye.pl script works when connecting to www.soaplite.com but
      fails when I attempt to connect to localhost. I have seen this problem
      discussed a few times and have tried the suggestions but I am still
      getting the same error:

      not well-formed (invalid token) at line 1, column 1, byte 1 at
      /usr/lib/perl5/XML/Parser.pm line 187

      hibye.pl:

      #!/usr/bin/perl -w

      use SOAP::Lite +trace => 'debug';

      print SOAP::Lite
      -> readable(1)
      -> uri('urn:Demo')
      -> proxy('http://localhost/hibye.cgi')
      -> hi()
      -> result;

      hibye.cgi:

      #!/usr/bin/perl -w

      # -- SOAP::Lite -- guide.soaplite.com -- Copyright (C) 2001 Paul
      Kulchenko --

      use SOAP::Transport::HTTP;

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

      package Demo;

      sub hi {
      return "hello, world";
      }

      sub bye {
      return "goodbye, cruel world";
      }

      sub languages {
      return ("Perl", "C", "sh");
      }


      Here is the trace:

      ./hibye2.pl
      SOAP::Transport::HTTP::Client::send_receive: POST
      http://127.0.1.1/hibye.cgi HTTP/1.1
      Accept: text/xml
      Accept: multipart/*
      Accept: application/soap
      Content-Length: 448
      Content-Type: text/xml; charset=utf-8
      SOAPAction: "urn:Demo#hi"

      <?xml version="1.0" encoding="UTF-8"?>
      <soap:Envelope
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
      <hi xmlns="urn:Demo" xsi:nil="true" />
      </soap:Body>
      </soap:Envelope>
      SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
      Connection: close
      Date: Sat, 09 Feb 2008 04:08:39 GMT
      Accept-Ranges: bytes
      ETag: "36015f-19d-5d331780"
      Server: Apache/2.2.4 (Ubuntu) mod_fastcgi/2.4.2 mod_python/3.3.1
      Python/2.5.1 PHP/5.2.3-1ubuntu6.3 mod_perl/2.0.2 Perl/v5.8.8
      Content-Length: 413
      Content-Type: text/plain
      Last-Modified: Sat, 09 Feb 2008 03:33:02 GMT
      Client-Date: Sat, 09 Feb 2008 04:08:39 GMT
      Client-Peer: 127.0.1.1:80
      Client-Response-Num: 1

      #!/usr/bin/perl -w

      # -- SOAP::Lite -- guide.soaplite.com -- Copyright (C) 2001 Paul
      Kulchenko --

      use SOAP::Transport::HTTP;

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

      package Demo;

      sub hi {
      return "hello, world";
      }

      sub bye {
      return "goodbye, cruel world";
      }

      sub languages {
      return ("Perl", "C", "sh");
      }

      not well-formed (invalid token) at line 1, column 1, byte 1 at
      /usr/lib/perl5/XML/Parser.pm line 187
      #!/usr/bin/perl -w

      # -- SOAP::Lite -- guide.soaplite.com -- Copyright (C) 2001 Paul
      Kulchenko --

      use SOAP::Transport::HTTP;

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

      package Demo;

      sub hi {
      return "hello, world";
      }

      sub bye {
      return "goodbye, cruel world";
      }

      sub languages {
      return ("Perl", "C", "sh");
      }
      at ./hibye2.pl line 5


      Any help would be appreciated.
    Your message has been successfully submitted and would be delivered to recipients shortly.