Web Service Validation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to verify a web service is up before executing function calls from a windows based application against it? I have heard of programs hanging while trying to connect to a service that is not available. How can I guard against this using c#?

Respectfully,

Dean Bortell
 
Due to the very nature, you will never know :(. If you just want to see if
the machine is reachable, you could try pinging it. Of course, this doesn't
mean the service is/isn't available. The only REAL way to know if a method
call will succeed is to do it.

However, the app shouldn't hang if method calls are done asyncronously. Why
not look into doing it that way instead?

-Michael
MVP
 
Due to the very nature, you will never know :(. If you just want to see if
the machine is reachable, you could try pinging it. Of course, this doesn't
mean the service is/isn't available. The only REAL way to know if a method
call will succeed is to do it.

However, the app shouldn't hang if method calls are done asyncronously. Why
not look into doing it that way instead?

-Michael
MVP

I guess it could take a while if the timeout is set high enough. I have
seen some calls taking some time to return an exception - but eventually
they all do return.
 
Back
Top