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

3561Re: SOAP::Lite hack for compatibility of mod_perl2

Expand Messages
  • rcalosso
    May 6, 2004
    • 0 Attachment
      I tried to apply this patch to my SOAP::Lite (60a) and am getting
      Can't locate object method "send_http_header" via package
      Apache:RequestRec" with the following:

      $r->send_http_header(join ';',$self->resonse->content_type);

      line around # 475

      Can anyone help me with the patches needed to get SOAP::Lite to work
      with mod_perl 1.99.xx.

      Thanks


      --- In soaplite@yahoogroups.com, "Michael Stepanov"
      <nite_man_2001@y...> wrote:
      > 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