Sipwiz's answer is absolutely the same as I would do - check out the specific method you can call to get a response from your WCF service.
However, be aware of some limitations here: it will only prove that your customer can call your service code. That may be enough for you - great. But, in my experience, the real problem is that other service methods are more likely to access other services and / or databases or what you should actually be doing. These systems may also be inaccessible / inaccessible, in which case your .IsAlive() will correctly .IsAlive() “everything is fine for this service”, but when you go to actually call one of the “real” methods of work, it can very much suffer a failure.
Basically, if you really want to know if all of your service methods will be called right now, you will need to call each of them using some test data or find another way to find out if their backend systems are alive. But such an .IsEverythingAlive() method can turn into a completely monster and take quite a long time to complete and is still not really useful ... even if this method returns “everything is fine”, after a microsecond later, when your real call comes, one of the backend systems may be dead.
So, while .IsAlive () gives you a quick and easy way to determine if you can really achieve your own service, it really is not a guarantee that your real call will succeed - you just cannot check it ... you must always assume that he will fail and deal with the possibility of failure and / or timeout.
Mark
marc_s
source share