user1034912
user1034912

Reputation: 2257

How can I browse all WCF services on a host?

I want to create a client and a server program using WCF. The communication between them will be TCP. The client will be a windows form where one can insert the host name and then it will list all the servers running on that machine.

Is there a way to do this? I.e. to browse all the WCF services in the machine host?

Upvotes: 4

Views: 3856

Answers (2)

Daniel Holder
Daniel Holder

Reputation: 111

WCF Discovery - http://msdn.microsoft.com/en-us/library/dd456782.aspx

Windows Communication Foundation (WCF) provides support to enable services to be discoverable at runtime in an interoperable way using the WS-Discovery protocol. WCF services can announce their availability to the network using a multicast message or to a discovery proxy server. Client applications can search the network or a discovery proxy server to find services that meet a set of criteria.

How to: Programmatically Add Discoverability to a WCF Service and Client - http://msdn.microsoft.com/en-us/library/dd456783.aspx

Upvotes: 4

Jay
Jay

Reputation: 625

There's no automatic way to do this. There have been various directory service protocols over the years but they've never really taken off. The one that has had most success overall is known as Multicast DNS or zeroconf. However the Windows APIs don't support it very well. Apple supports it under the name Bonjour and Linux supports it under the name Avahi.

The closest Windows equivalent is UPnP SSDP but after some well publicized security vulnerabilities were found, Microsoft dropped support for it by and large. There was an IPv6 rough equivalent known as PNRP (Peer Name Resolution Protocol) but this has also largely fallen out of use.

So, really your choices are to find an mDns library for Windows or to write your own.

Upvotes: 0

Related Questions