2.5.3.2.2 Consume a Web Service

See the diagram named WCF use cases in section 2.5.3.1.

Goal: The web client consumes the Web service according to the service contract. "Consume" means that the Web service successfully fulfills the web client's request.

Context of Use: An end user performs a task on a web client that requires consumption of a Web service.

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

Supporting Actor: The supporting actor is a Web service, which provides the remote application that the web client consumes.

Preconditions: The Web service is connected to the network.

Trigger: When an end user visits a website, uses a web application, or performs a transaction on the web, that site or application might access a Web service. The end user is not necessarily aware that a Web service is involved in the task at hand. The web client makes a request on a Web service endpoint. For example, an end user uses a web browser to visit a weather reporting website. When the website's home page loads, it accesses one or more Web services to retrieve weather-related data.

Main Success Scenario:

  1. The web client discovers the Web service (obtains its URI).

  2. The web client sends a request message to the Web service's URI.

  3. The Web service validates the service contract, which describes the service's functionality and communication format.

  4. If the contract is valid, the Web service sends a response message to the web client.

    Extension:

  5. If the web client does not already have the URI of the service, it can obtain it dynamically by using WS-Discovery as described in the use case in section 2.5.3.2.1.

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

Success Guarantee: The web client consumes the Web service according to the service contract.