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

Problem with Linux, Apache 2.0.40, mod_perl1.99 and latest CPAN code

Expand Messages
  • lloydc99
    I m installing a SOAP service using modperl but I m getting an error when I try to access the service. It works fine on my windows installation but the linux
    Message 1 of 1 , Aug 22, 2002
    • 0 Attachment
      I'm installing a SOAP service using modperl but I'm getting
      an error when I try to access the service. It works fine
      on my windows installation but the linux installation doesn't.
      It does work as a cgi and daemon under linux.

      When I access the service I get the follwoing error in the log.

      Undefined subroutine &Apache::Constants::OK called at
      /usr/lib/perl5/site_perl/5.6.1/SOAP/Transport/HTTP.pm line 444.

      I had an older of SOAP::Transport::HTTP that worked:
      $Id: SOAP::Transport::HTTP.pm,v 0.51 2001/07/18 15:15:14 $

      sub handler {
      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; }
      ));
      $self->SUPER::handle;

      if ($self->response->is_success) {
      $self->response->headers->scan(sub { $r->header_out(@_) });
      $r->send_http_header(join '; ', $self->response->content_type);
      $r->print($self->response->content);
      } else {
      $self->response->headers->scan(sub { $r->err_header_out(@_) });
      $r->content_type(join '; ', $self->response->content_type);
      $r->custom_response($self->response->code, $self->response->content);
      }
      $self->response->code;
      }

      The latest version that I got from CPAN doesn't. It is:
      $Id: HTTP.pm,v 1.11 2002/04/15 17:35:11 paulk Exp $

      sub handler {
      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; }
      ));
      $self->SUPER::handle;

      # we will specify status manually for Apache, because
      # if we do it as it has to be done, returning SERVER_ERROR,
      # Apache will modify our content_type to 'text/html; ....'
      # which is not what we want.
      # 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(@_) });
      $r->send_http_header(join '; ', $self->response->content_type);
      $r->print($self->response->content);
      &Apache::Constants::OK;
      }

      I have to admit that I don't understand all the sophistication
      of the way this module is handling it's packages. It appears to
      be declaring the constants only where they are used, but this one
      must have been skipped. I'm not sure how to go about fixing it
      without messing with the other stuff.

      Chuck Lloyd
    Your message has been successfully submitted and would be delivered to recipients shortly.