XML Web Services

An XML Web service is programmable application logic that is accessible by using standard Internet protocols. XML Web services combine the best aspects of component-based development and the World Wide Web. Like components, XML Web services represent black-box functionality that can be reused without regard to how the service is implemented. Unlike previous component technologies, XML Web services are not accessed through object model-specific protocols, such as the Distributed Component Object Model (DCOM), remote method invocation, or Internet Inter-ORB Protocol (IIOP).

Instead, XML Web services are accessed through ubiquitous Web protocols and data formats, such as Hypertext Transfer Protocol (HTTP), Extensible Markup Language (XML), and SOAP. Furthermore, an XML Web service interface is defined strictly in terms of the messages the XML Web service accepts and generates. Consumers of an XML Web service can be implemented on any platform in any programming language, provided they can create and consume the messages defined for the XML Web service interface.

Building or consuming XML Web services involves specifications and technologies that address five requirements for service-based development:

  • A standard way to represent data

  • A common, extensible message format

  • A common, extensible service-description language

  • A way to discover services located on a particular Web site

  • A way to discover service providers

The following paragraphs describe how these requirements are met.

Representing data with XML

XML is the obvious choice for a standard way to represent data related to XML Web services (that is, as the format of the data transmitted to and from the XML Web service). As such, the various XML Web service-related specifications all use XML for data representation.

Using SOAP as a messaging protocol

XML Web services require a messaging protocol that can invoke the XML Web services and exchange data with them. SOAP is a lightweight, XML-based protocol for exchanging information in a decentralized, distributed environment. SOAP is a network protocol, with no underlying explicit programming model. Because SOAP does not mandate the technology used to implement the client or server applications, it requires no application programming interface (API) or object model. As such, SOAP provides an open methodology—XML Web services—for application-to-application communication.

Using WSDL as a contract language

An XML Web service honors a contract with its clients regarding the messages it accepts and generates. To support this, Microsoft and IBM jointly developed an XML-based contract language, called Web Services Description Language (WSDL), as a standard mechanism for creating and interpreting Web service contracts. WSDL is used to create a file that identifies the services and the set of operations within each service that the server supports. The WSDL file also describes the format that the client must follow in requesting an operation. WSDL is analogous to the Interface Definition Language (IDL) for COM components.

The operations in the WSDL file are defined by the style attribute of the <soap:binding> element in the file, and can be one of the following:

  • Document-oriented operations. If an operation in the WSDL file is document-oriented, the input (request) and output (response) messages specified for that operation contain XML documents.

  • RPC-oriented operations. RPC-oriented operations have input messages that contain the operation's input parameters and output messages that contain the operation's results.

Discovering services and service providers

XML Web service clients need to be able to discover where XML Web services are located. The Discovery Protocol (Disco) specification defines a discovery document format based on XML, and a protocol for retrieving the discovery document, enabling developers to discover services at a known URL. However, in many cases the developer will not know the URLs where services can be found. Universal Description, Discovery, and Integration (UDDI) specifies an advertising mechanism for Web service providers, and a location device for Web service consumers.


Show: