in reply to Add custom return parms to SOAP::Transport::HTTP::Apache

Subclass SOAP::Transport::HTTP::Apache and override dispatch_to. In your version, set up a local warn handler (local $SIG{__WARN__} = sub { ... }) which stores off any error text then call $self->SUPER::dispatch_to( ...  ). After that returns, muck with the XML to add whatever your warn handler stored (if anything).

Replies are listed 'Best First'.
Re: Re: Add custom return parms to SOAP::Transport::HTTP::Apache
by habit_forming (Monk) on May 12, 2004 at 21:45 UTC
    Well I tried that but unfortunately the XML to be returned is not actaully returned by the $self->SUPER::dispatch_to( ...  ) function but is print'ed somewhere deep in the SOAP::* modules. (I have not found out exactly where yet.)

    So my options are kind-of limited. =(

    --habit

      Hrmm, looks like it's returned by SOAP::Transport::HTTP::Server by calling a coderef (look for $response_content_writer in SOAP::Transport::HTTP::Apache) which is passed to its handle_request method (which prints to an Apache instance obtained with Apache->request()). All of the class names are hardcoded so there's not really a clean way to subclass. What you're going to have to do is basically make your own version of S::T::H::Apache and modify the coderef to do the error mucking.