views:

1094

answers:

2

What is the best way to check is the WCF service exists in a given ip and port? I want to check is the server exists on client installetion

+4  A: 

The only way to know if the "service" "exists" is to call it.

To this purpose, many services include a "Ping" operation (or perhaps a "GetServerInformation" operation) that, when called, does little or nothing, other than prove the the service exists.

John Saunders
+2  A: 

I know you already marked an answer here, but you might consider checking out this related thread: http://stackoverflow.com/questions/881754/how-to-check-the-availability-of-a-net-tcp-wcf-service

There is a good alternative in there using a supported WS-Discovery method that might suit your needs, depending on your access to the service itself.

Anderson Imes
Good post Andy,Thanks. But isn't it slow? my service has a big metadata...
ArsenMkrt
It only transfers endpoint information, not operation information. It's pretty lightweight as long as your service doesn't have lots of endpoints.
Anderson Imes