Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Error handling on_fault and return params to the caller file (abc.mp)

by mr.nick (Chaplain)
on Jun 28, 2012 at 13:44 UTC ( [id://978930] : note . print w/replies, xml ) Need Help??


in reply to Error handling on_fault and return params to the caller file (abc.mp)

Since SOAP::Lite natively throws exceptions via die() when an error occurs (I think?), you should do the same in your on_fault routine.

Here's what I do:

$soap->on_fault( sub { my ( $soap, $res ) = @_; if ($res) { if ( ref $res ) { die join( '; ', $res->faultcode, $res->faultstring +, $res->faultdetail ) . "\n"; } else { die $res; } } else { die "Soap Fault: " . $soap->transport->status . "\n"; } } );

Then later in the client...

eval { $soap->Method("arguments"); }; if ($@) { // provide some user feedback about the error in $@ }

mr.nick ...

Replies are listed 'Best First'.
Re^2: Error handling on_fault and return params to the caller file (abc.mp)
by nitins818@gmail.com (Initiate) on Aug 20, 2012 at 09:32 UTC
    SOAP::LITE is single threaded ???
    If it is true then how to change it to multiple?

    It can help me to save my client if my service server dies ...

    Please Help ...
      create a new soap lite object in each subthread