Call a method and catch/test the System.Net.WebException. This being the
case, it does not make sense to perform this task twice, just be sure you
make all of your webmethod calls in a try/catch block.
Calling a webmethod to test for an error only to turn around and call it (or
another method) again to get results does not make sense.
You can pink the server (if it responds to pings) to see if the server is
up, but you are going to have to rely on status codes (errors) to see if the
actual web service is responding.
HTH,
John Scragg
[quoted text, click to view] "Chinedu" wrote:
> Please help guys,
>
> I wondering if there is a way to test a web service for availability. i.e a
> simple test to see if the webservice is up and running or available before I
> make the actual method call on the webservice...something like a ping in
> networking
>
>
> --
you can type the URL of the webservice in IE
http://<yourserver>/webapp/webservice.asmx?wsdl (this will give you xml
display - which says your webservice is active )
http://<yourserver>/webapp/webservice.asmx (this will give you web based
form to invoke and check your webserives..)
[quoted text, click to view] "Chinedu" wrote:
> Please help guys,
>
> I wondering if there is a way to test a web service for availability. i.e a
> simple test to see if the webservice is up and running or available before I
> make the actual method call on the webservice...something like a ping in
> networking
>
>
> --
Hi,
what you could do is make a simple HttpRequest to the 'index page' of
the webservice. Catch the HTTP timeout or error code returned. This
will tell you if it's "up & running". There is ofcourse still a race
condition if anything happens to the server between you check and the
first WebService call... but you would know up front if its down.
Hope this helps,
Marvin Smit.
On Mon, 24 Oct 2005 09:29:04 -0700, "Chinedu"
[quoted text, click to view] <Chinedu@discussions.microsoft.com> wrote:
>Please help guys,
>
>I wondering if there is a way to test a web service for availability. i.e a
>simple test to see if the webservice is up and running or available before I
>make the actual method call on the webservice...something like a ping in
Don't see what you're looking for? Try a search.