2.5.3.2.1 Dynamically Discover a Web Service

See the diagram named "WCF use cases" in section 2.5.3.1.

Goal: The web client obtains the uniform resource identifier (URI) of the Web service.

Context of Use: A web client requires the use of a Web service, but the identifying address (URI) of the Web service is unknown. The web client dynamically seeks a suitable Web service (the target service); this process is called service discovery.

Primary Actor: The primary actor is the web client, an application that resides on the end user's computer, and makes requests to a server over a network connection.

Supporting Actor: The supporting actor is a Web service. This provides a remote computing or data access function that a web client can dynamically discover and consume.

Preconditions: The following enables a Windows Communication Foundation (WCF) Web service to become discoverable over UDP on a network by using WS-Discovery ([WS-Discovery]).

  • The Web service is connected to the network.

  • The Web service application developer enables discovery of the service. In WCF, the developer adds a discovery endpoint to enable service discovery.

Trigger: Web service discovery can be initiated in two ways: A developer can perform Web service discovery manually and statically bind the Web service's URI to the web client application. Alternatively, when the web client does not already have the location of a service appropriate to a particular task, the web client can initiate discovery of a Web service by performing the steps that are listed under Main Success Scenario in this section.

Main Success Scenario:

  1. The web client searches for a Web service with a multicast Probe message specifying the contract type (the methods that are exposed by the service).

  2. The Web service responds with a unicast Probe Match message.

  3. The web client sends a multicast Resolve message requesting the Web service's URI.

  4. The Web service responds with a unicast Resolve Match message containing its address (URI).

The web client uses a multicast discovery protocol that is called WS-Discovery ([WS-Discovery]) to locate the Web service on a network. The detailed steps in discovering the service are described in [WS-Discovery] section 3. The client can add constraints to the probe and response messages as described in [MS-WSTC].

Minimal Guarantees: If the service is unavailable, the web server does not respond to the client. No data on the web client or the web server is changed.

Success Guarantees: The system guarantees the following:

  • The web server responds to requests from the web client.

  • The discovery service obtains the URI of the Web service.

  • The web client receives the URI of the Web service.