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

returning faults with die under mod_perl

Expand Messages
  • ed-soaplite@inkdroid.org
    Have any SOAP::Lite users noticed strange things happening when attempting to throw faults with die() when serving both SOAP and XMLRPC under mod_perl? Here s
    Message 1 of 1 , Mar 10, 2003
    View Source
    • 0 Attachment
      Have any SOAP::Lite users noticed strange things happening when
      attempting to throw faults with die() when serving both SOAP and XMLRPC
      under mod_perl?

      Here's the scenario:

      I have a SOAP server listening on http://www.example.com/soap
      and a XMLRPC server listening on http://www.example.com/xmlrpc.
      Both work fine in tandem, but once either of them throw a fault with
      die the other is suddenly unable to find their dispatch directory.

      Failed to access class (SOAP::Test): Can't locate SOAP/Test.pm in
      @INC (@INC contains: /FLR/External) at (eval 516) line 3

      Here is my handler SOAP handler, note it determines the dispatch directory
      dynamically since the server can be running in a variety of contexts
      (developement/production).

      use strict;
      use warnings;
      use SOAP::Transport::HTTP;

      ## need to sanitize PERL5LIB since mod_perl runs under taint checking
      my ($perl5lib) = ( $ENV{PERL5LIB} =~ /^([a-zA-Z0-9\/]+)$/ );

      ## we dispatch to any modules that live in our SOAP directory
      my $server = SOAP::Transport::HTTP::Apache
      -> dispatch_to( "$perl5lib/FLR/External" );

      sub handler { $server->handler(@_); }

      It seems to me that the call to die is invalidating the $perl5lib
      variable somehow since if I hard code the directory:

      my $server = SOAP::Transport::HTTP::Apache
      -> dispatch_to( "/home/esummers/Lib/FLR/External" );

      all the handers work fine after a die.

      If anyone has any ideas I'd appreciate the feedback.

      //Ed
    Your message has been successfully submitted and would be delivered to recipients shortly.