in reply to SOAP::Lite reconnect

I am aware of on_fault but not sure how that can help me reconnect n number of times.

Replies are listed 'Best First'.
Re^2: SOAP::Lite reconnect
by cowboy (Friar) on Jun 14, 2006 at 22:53 UTC
    Try something like this (not the best example, I find SOAP::Lite quite powerful, but difficult to understand at the same time - untested code).
    my $soap; my $tries = 0; my $success = 0; while ($tries < 10 && !$success) { $success = 1; # set it to one, on fault, we'll set it to 0 $soap = SOAP::Lite -> on_fault(sub { $success = 0; }), -> uri('http...ect'); ++$tries; }
    Update: fixed typo (thanks ptum)