Previous section   Next section

16.1 SOAP, WSDL, and Discovery

What is needed to make web services possible is a simple, universally accepted protocol for exposing, finding, and invoking web service functions. In 1999, Simple Object Access Protocol (SOAP) was proposed to the World Wide Web Consortium. SOAP has the advantages of being based on XML and of using standard Internet communications protocols. SOAP is a lightweight, message-based protocol built on XML, HTTP, and SMTP.

Two other protocols are desirable, but not required, for a client to use a SOAP-enabled web service: Discovery and Description.

It is through the discovery process that web service clients learn that a service exists, what its capabilities are, and how to properly interact with it. A Discovery (.disco) file provides information to help browsers determine the URLs at any web site at which web services are available. When a server receives a request for a .disco file, it generates a list of some or all of the URLs at that site that provide web services.

The description of the methods provided by a particular service that can be understood and acted upon by clients is provided in .NET by the Web Service Description Language (WSDL) protocol, jointly developed by Microsoft, IBM, and others. WSDL is an XML schema used to describe the available methods�the interface�of a web service.

16.1.1 Server-Side Support

The plumbing necessary to discover and invoke web services is integrated into the .NET Framework and provided by classes within the System.Web.Services namespace. Creating a web service requires no special programming on your part; you need only write the implementing code, add the [WebMethod] attribute, and let the server do the rest. You can read about attributes in detail in Chapter 18.

16.1.2 Client-Side Support

You make use of a web service by writing client code that acts as though it were communicating directly with a local class. However, in reality, the client interacts with a proxy. The job of the proxy is to represent the server on the client machine, to bundle client requests into SOAP messages that are sent on to the server, and to retrieve the responses that contain the result. Proxies and the details of dealing with objects on other machines are covered in detail in Chapter 19.


  Previous section   Next section
Top