inzoik has asked for the wisdom of the Perl Monks concerning the following question:

SOAP::Transport::HTTP seems to be using a deprecated way of using HTTP::Headers. I am currently using version 0.714 and looking at SOAP/Transport/HTTP.pm +806 which among other things is cloning a APR::Table object into a HTTP::Headers object.

$r->headers_in always returns a hash reference in mod_perl 2 , though it was returning a hash in mod_perl 1 when called in list context.

On the other hand HTTP::Headers always required a hash. What did change was that HTTP::Headers prior to version 6.0 didn't have a validation check on the key.

Can someone please confirm that I am not imagining a problem here and SOAP::Lite truly is calling HTTP::Headers assuming a 1.0 style libapreq ?

  • Comment on SOAP::Lite incompatible usage of HTTP::Headers

Replies are listed 'Best First'.
Re: SOAP::Lite incompatible usage of HTTP::Headers
by Anonymous Monk on Mar 12, 2013 at 00:43 UTC

    Can someone please confirm that I am not imagining a problem here

    I doubt it -- you could try MKUTTER/SOAP-Lite-0.715.tar.gz

Re: SOAP::Lite incompatible usage of HTTP::Headers
by inzoik (Novice) on Mar 12, 2013 at 15:43 UTC
    Nope 0.715 also has the same piece of code.

    What worries me is that the HTTP::Headers change happened in 2011 which is why I need a sanity check as to whether SOAP::Lite is truly broken in the webservice mode.

Re: SOAP::Lite incompatible usage of HTTP::Headers
by inzoik (Novice) on Mar 26, 2013 at 23:09 UTC

    soap_fail.conf

    LoadModule apreq_module modules/mod_apreq2.so Listen 8998 ErrorLog /home/inzoik/soap_fail/global_err PidFile /home/inzoik/soap_fail/soap_fail.pid <Location /session> SetHandler perl-script PerlHandler Apache::SOAP PerlSetVar dispatch_to "/home/inzoik/soap_fail/webservice/" </Location>

    webservice/Hello.pm

    package Hello; sub echo { return @_; }; 1;
    Started the webservices using the following command
    /apache/httpd-2.2.16/bin/httpd -f /home/inzoik/soap_fail/soap_fail.con +f

    test.pl

    use SOAP::Lite; my $soap = SOAP::Lite->uri('http://myhost:8998/Hello')->proxy('http:// +myhost:8998/session'); $soap->echo('Hello', 'World');
    Running test.pl gives me
    500 Internal Server Error at ./test.pl

    global_err

    [Tue Mar 26 17:53:40 2013] [notice] Apache/2.2.16 (Unix) mod_apreq2-20 +090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming norma +l operations [Tue Mar 26 17:59:27 2013] [error] [client 10.32.238.200] Illegal fiel +d name 'APR::Table=HASH(0xb7e2de0)' at /perl/5.10.1/lib/site_perl/5.1 +0.1/SOAP/Transport/HTTP.pm line 806\n
Re: SOAP::Lite incompatible usage of HTTP::Headers
by inzoik (Novice) on Mar 26, 2013 at 23:26 UTC
    Ofcourse I assume my problem I was using Apache::SOAP. Changed conf to use Apache2::SOAP as follows

    soap_fail.conf

    LoadModule apreq_module modules/mod_apreq2.so Listen 8998 ErrorLog /home/inzoik/soap_fail/global_err PidFile /home/inzoik/soap_fail/soap_fail.pid <Location /session> SetHandler perl-script PerlResponseHandler Apache2::SOAP PerlSetVar dispatch_to "/home/inzoik/soap_fail/webservice/" </Location>
    Running the same test.pl gives me the following in global_err
    [Tue Mar 26 18:22:17 2013] [notice] Apache/2.2.16 (Unix) mod_apreq2-20 +090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming norma +l operations [Tue Mar 26 18:22:23 2013] [error] [client 10.32.238.200] Illegal fiel +d name 'APR::Table=HASH(0x8274070)' at /perl/5.10.1/lib/site_perl/5.1 +0.1/SOAP/Transport/HTTP2.pm line 103\n

      I met with exactly the same problem. Changing line 103 of SOAP/Transport/HTTP2.pm to below can fix the symptom.

      $self->request(HTTP::Request->new( $r->method() => $r->uri, HTTP::Headers->new(%$r->headers_in), do { my ($c,$buf); while ($r->read($buf,$cl)) { $c.=$buf; } $c; } ));
      looks like a bug.
        I see the same bug also. For me it just became apparent as the site I work on switched from perl 5.12 to perl 5.16. (Possibly why the bug was not more widely reported.)