Re: Soap::Lite a web service not available collapses a cgi?

Jeremy Howard <[email protected]> Thu, 5 Jun 2003 10:10:32 +1000
Newsgroups gmane.comp.windows.devel.soap.general
Message-ID <016b01c32af6$e579ec00$1200a8c0@sammy>
>    I have a web service, I kwow its address, but before I use it I want to
> know if it's online. So I made a method named 'isAvailable' which
> returns 'on' and if the web service is not available it returns nothing.
> Okey. The problem is that I invoke this method from a perl cgi and when
the
> method is invoked and it isn't found (the web service is not available
> because the server is down, etc.. ), I think SOAP::Lite makes a 'die'
> command somewhere and my .cgi dies too and nothing gets printed afterwards
> and this is not what I want! :( . There is any way to make SOAP::Lite
> not 'die' on my cgi? Or, there is other method that I could use to find
out
> if a web service is available (from a perl cgi).

Use:
----
  eval {your_method()};
  if (my $err = $@) {
    # service is down
  } else {
    # service is up
  }
----

--
  jeremy