Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

SOAP::Lite - 500 Errors - Please Fail Gracefully

by vbrtrmn (Pilgrim)
on Mar 30, 2011 at 16:58 UTC ( [id://896470]=perlquestion: print w/replies, xml ) Need Help??

vbrtrmn has asked for the wisdom of the Perl Monks concerning the following question:

I've got my SOAP application working and it works very well, I found SOAP::Lite very easy to implement. Today, I was wondering, "What would happen if the SOAP app server was down." So, I modified the wsdl and proxy to invalid URLs and I started to get some 500 errors, which I kind of expected. In the Apache logs I consistently get the following, which is what I expect.
500 Can't connect to 255.255.255.255:80 (connect: timeout)
My question is: Is there a good way to fail gracefully?

Code snippet:
my $soapClient = SOAP::Lite->new(
	service	=>	"file:/home/test/files/my.wsdl.xml",
	proxy	=>	"http://255.255.255.255/services/soapservice"
);

# Using the call() method causes the 500 error, because there's obviously nothing on 255.255.255.255 
$som = $soapClient->call('getCustomerNameByIPAddress','10.10.10.10');

--
paul

  • Comment on SOAP::Lite - 500 Errors - Please Fail Gracefully

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://896470]
Approved by ikegami
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2026-01-19 09:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (122 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.