Aug 26, 2009

WS-Discovery 101: What is this thing?

This is a continuation of a series of posts on the new WS-Discovery features coming in WCF in NET 4.0. For the entire series, see here.

Windows Communication Foundation has had one of the most profound effects to the type of applications I see written since .NET 1.0 in my opinion. It made creating a Service Oriented Architecture that much more attainable.

If you look at any list of SOA Principles, there is (arguably) only one thing missing from Microsoft’s WCF strategy where it applies to SOA: Discoverability. This is what makes the addition of WS-Discovery so important to WCF. It paints a complete picture of a path to service orientation that was previously a lot of work to implement.

This is not to say that only those shooting for the lofty and often “enterprise” specific goal of SOA is the only reason to use WS-Discovery. You’d use WS-Discovery if you like any of these things:

  • Client finds endpoints that host a service without pre-configuration or a central store of endpoint information
  • Client finds all endpoints across a network that match certain criteria (contract, scope, etc).
  • Service is able to publish additional metadata about its endpoints to clients prior to use
  • Clients or a central service are notified when a service goes up or down

These are just a few of the features you get from WS-Discovery out of the box with very little configuration or coding.

Let’s talk about a few key words that will help when reading future articles.

Probing

Probing is the process of sending out a request to either an entire network subnet via a UDP multicast message (referred to as “Ad-Hoc discovery”) or to a central discovery proxy (proxies will be described at length in a later article).

Basically we are sending out a request saying “here’s what I’m looking for… is anyone out there that matches this criteria?”. Here’s a (hopefully) helpful diagram.

Any services that either don’t respond to discovery probes or aren’t a match for the criteria simply don’t respond to the probe request.

Announcement

Announcement is the process by which a service that has newly come up announces its availability to either a central discovery proxy or to all clients on the subnet. In this case, the client can take advantage of “push” notification messages from services coming online, rather than probing the network to find a matching service. Here’s another basic diagram.

Now we have a common language we can work with for the rest of the series.

No comments:

Post a Comment