From: Mark C. <ma...@nc...> - 2011-06-25 19:45:45
|
The behaviour of headers_in() has changed from Apache v1.x / mod_perl to Apache2 / mod_perl2. Its behaviour in Apache v1 / mod_perl v1 is documented here: http://search.cpan.org/~gozer/mod_perl-1.31/Apache/Apache.pm#THE_REQUEST_OBJECT and the Apache2 / mod_perl2 behaviour is documented here: http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_headers_in_ With Apache2 / mod_perl2, the $r->headers_in() call in SOAP::Transport::HTTP::Apache->handler() does not return a hash (or list of key, value pairs) of the HTTP headers, but instead returns an APR object. So HTTP::Headers->new( $r->headers_in ) does not initialise the HTTP::Headers object properly, and so the Apache::SOAP object does not receive the headers. One consequence of this is that the on_action() consistency test method (at the server) is never called because the action is never set, even when there is a SOAPAction HTTP header. The patch below is a simple fix for this; I believe it will work with both Apache v1.x / mod_perl and Apache2 / mod_perl2, but I have tested it with the latter only. *** HTTP.pm.orig 2010-06-03 23:35:51.000000000 +0100 --- HTTP.pm 2011-06-25 19:49:13.000000000 +0100 *************** *** 796,805 **** return Apache::Constants::BAD_REQUEST(); } $self->request( HTTP::Request->new( $r->method() => $r->uri, ! HTTP::Headers->new( $r->headers_in ), $content ) ); $self->SUPER::handle; --- 796,814 ---- return Apache::Constants::BAD_REQUEST(); } + my $headers = HTTP::Headers->new(); + if ( $self->{'MOD_PERL_VERSION'} < 2 ) + { + $headers->header( $r->headers_in ); + } + else + { + $headers->header( %{$r->headers_in} ); + } $self->request( HTTP::Request->new( $r->method() => $r->uri, ! $headers, $content ) ); $self->SUPER::handle; |