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

Call on SOAP::Transport::HTTP::Apache->handler() causes XML Parser error

Expand Messages
  • denis.simonet@rocketmail.com
    Hi all Since an update of Apache, mod_perl and SOAP::Lite (on Debian) a mod_perl module which uses SOAP::Lite doesn t work anymore. It causes an error in the
    Message 1 of 1 , Jun 30, 2011
    • 0 Attachment
      Hi all

      Since an update of Apache, mod_perl and SOAP::Lite (on Debian) a mod_perl module which uses SOAP::Lite doesn't work anymore. It causes an error in the XML parser. The SOAP request and the answer are:

      REQUEST:
      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://url/name" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:getCustomerReservationList><refP xsi:type="xsd:string">00123456</refP><lang xsi:type="xsd:string">fr</lang></ns1:getCustomerReservationList></SOAP-ENV:Body></SOAP-ENV:Envelope>

      RESPONSE:
      <?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:ns1="http://url/name"
      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>
      <soap:Fault>
      <faultcode>soap:Client</faultcode>
      <faultstring>Application failed during request deserialization:
      no element found at line 1, column 0, byte -1 at /usr/lib/perl5/XML/Parser.pm line 187
      </faultstring>
      </soap:Fault>
      </soap:Body>
      </soap:Envelope>

      The important perl part:
      ---
      use strict;
      use Apache2::Const qw(:common :http);
      use base qw(Tcs::View::Interface);
      use HTML::Entities qw(encode_entities_numeric);
      use SOAP::Transport::HTTP;

      my $namespace = 'http://url/name';
      my $server = SOAP::Transport::HTTP::Apache
      ->options({ns => $namespace})
      ->dispatch_to('N::View::Interface::Modulename::Responder')
      ->dispatch_with({'' => 'N::View::Interface::Modulename::Responder',
      $namespace => 'N::View::Interface::Modulename::Responder'});

      $server->serializer->register_ns($namespace => 'ns1');
      $server->serializer->readable(1);
      $server->serializer->default_ns($namespace);


      sub handle
      {
      my ($self, $schema, $args, $r) = @_;
      my $ret;

      $N::View::Interface::Modulename::Responder::req = $r;
      $N::View::Interface::Modulename::Responder::schema = $schema;

      eval {
      $ret = $server->handler($r);
      };


      if ($@)
      {
      $req->warn($@);
      return (HTTP_BAD_REQUEST, $@);
      }

      return ($ret, '');
      }
      ---

      $r->args() contains the correct SOAP request (valid XML etc). The handler functions are in the same .pm file but in another package: N::View::Interface::Modulename::Responder::req

      The call $server->handler($r) causes the error message. Again extracted:
      Application failed during request deserialization:
      no element found at line 1, column 0, byte -1 at /usr/lib/perl5/XML/Parser.pm line 187

      Does anyone know why this happens? The same script works under an older version! The version installed now:
      ii libsoap-lite-perl 0.710.08-1

      Unfortunately i didn't find any useful hints with google and I was seeking for hours.

      Thank you in advance!

      Kind regards
      Denis
    Your message has been successfully submitted and would be delivered to recipients shortly.