Chapter 6. Web Services

Table of Contents

Web Services Description Language (WSDL)
Universal Description, Discovery and Integration (UDDI)
SOAP Web Services

Web services are the standardized way of communicating different web-based applications via network. By using Web services, your application can publish its function or message to the rest of the world. Web services can communicate with each other using XML file format without knowing how each other is implemented. Web based applications are communicating using the concepts as XML, SOAP, REST, WSDL and UDDI.

In the context of Service Oriented Architecture, Web Services are used to facilitate communication between service providers and service consumers.

W3C defines web service as a “software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.”

Different applications might be built with different programming languages, therefore there is a need for a method of data exchange that doesn't depend upon a particular programming language. In other words a web service is a collection of open protocols and standards used for exchanging data between applications or systems. Software applications written in various programming languages and running on various platforms can use web services to exchange data over computer networks like the Internet in a manner similar to inter-process communication on a single computer.

Here are the common properties of web services:

Usage of web services can be mentioned in two major parts. First one is ”reusable application components” and second one is to ”connect existing software”.

Reusable application components:There are sometimes some informations which many applications need to use. So why do we need to do these again and again. We can reuse the application components. Web services can offer some components like weather reports, currency conversion or language translation.

Connect existing software:You can connect your existing software to a Web service to utilize the data from which a web service provide.

Web Service Roles

Web service architecture can be expressed by mentioning some major roles of it. There are three major roles within the web service architecture:

Web Services overview

Service provider

This is the provider of the web service. The service provider implements the service and makes it available on the Internet.

Service requestor

This is any consumer of the web service. The requestor utilizes an existing web service by opening a network connection and sending an XML request.

Service registry

This is a logically centralized directory of services. The registry provides a central place where developers can publish new services or find existing ones. It therefore serves as a centralized trade center for companies and their services.

Web Services Description Language (WSDL)

WSDL describes the functionality of a web service and it is an XML based description language. A WSDL file contains information about how a web service can be called, what parameters it expects and what data structure it returns. The WSDL describes services as collections of network endpoints, or ports. The abstract definitions of ports and messages are separated from their concrete use.

This is good for allowing the reuse of these definitions. As you can see in the Figure ... it describes the structure of a WSDL file graphically. Concrete and Abstract sections are separated for reuse. I am going to mention about some major information given in a WSDL file.

structure of a WSDL file

Service:Contains a set of system functions that have been exposed to the Web-based protocols.

Endpoint:Defines the address or connection point to a Web service. It is typically represented by a simple HTTP URL string.

Binding:Specifies the interface and defines the SOAP binding style and transport ( SOAP Protocol). The binding section also defines the operations. There may be any number of bindings for a given portType.

PortType: Defines a Web service, the operations that can be performed, and the messages that are used to perform the operation. It is the most important element in WSDL. I can be compared to a module or a class in traditional programming.

Message: Typically, a message corresponds to an operation. The message contains the information needed to perform the operation. Each message is made up of one or more logical parts. Each part is associated with a message-typing attribute. The message name attribute provides a unique name among all messages.

Types:The types element defines the data types that are used by the web service. WSDL 1.1 allows the use of any typing system, but it uses W3C XML schema for maximum platform neutrality.