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

I have a Soap-Lite client implemented in Perl that queries a remote .Net SOAP service. All works will in test and production... until the remote server goes offline. Then the SOAP client hangs during the connection process. I had implemented an error handling routine that handles connection errors, but when the remote server went off the air, the connection never completed, thus never entering the fault (in a timely manner, that is). Now, the thing that confuses the heck out of me is that if I test this in condition in my lab environment, it takes about 2 seconds and then fails. If I do it in production, it never even makes it past the $result1 call to tell me how long it is taking. The only difference that I am aware of is that the production environment uses fiber and an ATM network adapter, and my lab uses standard ethernet. Any ideas?

Caveats - This is using SOAP-Lite 0.69 (I can't upgrade right now), and I have tried adding 'timeout' to the proxy (

SOAP::Lite -> uri('http://something.com') -> proxy('https://somesite.com/CollaborationTool_WS.asmx', t +imeout =>5);
) without any luck or change of behavior.

T

Client connector code below:

use SOAP::Lite on_action=> sub {sprintf '%s%s', @_},on_fault => \&faul +thandler; sub connectToSOAP { my $soap = SOAP::Lite -> uri('http://something.com') -> proxy('https://somesite.com/CollaborationTool_WS.asmx'); $soap->serializer->register_ns("http://schemas.xmlsoap.org/soap/ +envelope/","soap"); my $result1 = $soap ->call(SOAP::Data->name('GetEventInfoByEventID')->attr({xmlns => ' +http://something.com/'}) => SOAP::Data->name('EventID')->value($EventID)->type('') ); ## Never gets here if remote server is off air blah blah blah } sub faulthandler { my ($soap, $res) = @_; if ($debug) { die("*** SOAP Fault: " . $res->faultstring); } else { return 0; } }

Replies are listed 'Best First'.
Re: SOAP-Lite and connection problems
by banesong (Acolyte) on Nov 03, 2011 at 11:26 UTC
    Interestinger and interestinger (yes, I know that is horrible English). I managed to get an ethernet switch inserted between my servers and the ATM network and bingo, everything fails gracefully. My suspicion is that since the TCP stack that is used has a set timeout period whereas the ATM network does not, the timeouts built into the SOAP connection are able to be enforced. This type of thing might be why LAN based ATM is on the way out. Just an FYI!