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

3085SOAP::Lite hack for compatibility of mod_perl2

Expand Messages
  • Michael Stepanov
    Oct 27, 2003
      I've ported my application from Apache1 to Apache2 and I've needed to
      change all code where I called mod_per1 API.
      Also, I've hacked module SOAP::Lite::Transport::HTTP because it uses
      mod_perl1 API.
      I'd like to suggest you my patch. Of couse, I understand that it isn't
      good way. It will be better to include compatibility with both version
      of mod_perl. But I hope that my patch will help someone as temporary
      solution for migration to Apache2.

      --- /usr/lib/perl5/site_perl/5.8.0/SOAP/Transport/HTTP.pm
      2002-04-16 07:43:02.000000000 +0300
      +++ HTTP.pm 2003-10-24 14:00:22.000000000 +0300
      @@ -409,7 +409,7 @@

      sub DESTROY { SOAP::Trace::objects('()') }

      -sub new { require Apache; require Apache::Constants;
      +sub new { require Apache2; require Apache::Const;
      my $self = shift;

      unless (ref $self) {
      @@ -421,13 +421,14 @@
      }

      sub handler {
      + use Apache::Const qw(OK);
      my $self = shift->new;
      my $r = shift || Apache->request;
      $self->request(HTTP::Request->new(
      $r->method => $r->uri,
      HTTP::Headers->new($r->headers_in),
      - do { my $buf; $r->read($buf, $r->header_in('Content-length'));
      $buf; }
      + do { my $buf; $r->read($buf,
      $r->headers_in->get('Content-length')); $buf; }
      ));
      $self->SUPER::handle;

      @@ -438,10 +439,10 @@
      # will emulate normal response, but with custom status code
      # which could also be 500.
      $r->status($self->response->code);
      - $self->response->headers->scan(sub { $r->header_out(@_) });
      + $self->response->headers->scan(sub { $r->headers_out->set(@_) });
      $r->send_http_header(join '; ', $self->response->content_type);
      $r->print($self->response->content);
      - &Apache::Constants::OK;
      + OK;
      }

      sub configure {
    • Show all 3 messages in this topic