Web Service Architecture XML

As discussed earlier, you can create a Web service by using any programming language or tool. However, certain components in the architecture of a Web service are common to all Web services. The following list discusses these components:

  • All Web services require a standard format for transfer of data. In most cases, this standard format is XML.
  • Web services transfer data across a network by using a standard protocol called Simple Object Access Protocol (SOAP).
  • All Web services have a detailed description available with it in the form of an XML document called a Web Services Description Language (WSDL) document.
  • When you create a Web service, you can register it in a directory by using Universal Description, Discovery, and Integration (UDDI).

You will learn about these components in the later section "Components of a Web Service." Using these components, the internal structure of a Web service is divided into two layers: the listener layer and the business layer. The following section discusses these layers in detail.

Layers of a Web Service

The layers in the architecture of a Web service are as follows:

  • Listener layer
  • Business layer

The two layers in the internal structure of a Web service work in cooperation to allow applications to interoperate. These layers are shown in Figure.

Layers in a Web Service

Layers in a Web Service

The following sections discuss the layers of a Web service in detail.

The Listener Layer

As shown in Figure, the listener layer is the topmost layer in a Web service and is closest to the Web service client application. Therefore, when a client application needs to communicate with the Web service provider application, the client application sends a request to the listener layer of a Web service.

The listener layer interprets the request that the client application sends so that the Web service provider application understands the request. The request is then forwarded to the next layer in the Web service architecture. Similarly, when the request for the data is processed and the result is returned to the listener layer, the layer again converts the data to a form that the client application can decipher easily. The data is then sent to the clientapplication in the form of an XML message.

The Business Layer

When you create a Web service, you need to write the business logic for the Web service. The business layer implements this business logic so that the Web service is made accessible to the Web service client application. The business logic is divided into two layers: the business logic and the business facade layer. The functionality or the service provided by a Web service is made accessible to the client application by the business logic layer and the business facade layer provides the interface for the service.

The working of a Web service depends on the architecture of the Web service. The following section discusses the working of a Web service.

Working of a Web Service

To understand the working of a Web service, consider the example of a Web service, Credit_ Details, which validates the credit card details of a customer. Any Web service that you create consists of one or more Web methods. These Web methods expose the functionality of a Web service to the client application. Therefore, to access these Web methods, the client application sends a request for the Web methods by using the URL of the Web service.

In the example, the request that is sent to the listener layer consists of the URL of the Web service. In addition, the request contains the information, such as the name and the credit card number of the user. You need to pass this data as a parameter to the Web service call statement.

The listener layer receives the request for the Web service. After listening to the request of the client application, this layer interprets the request in the form of an XML message that is passed on to the business layer.

When the request reaches the business layer, the request needs to be processed according to the business logic of the Web service. The result of processing the request is sent back to the listener layer. This data is in the form of a SOAP package and is, therefore, converted by the listener layer in a form that the client application can understand. Finally, the data is transferred to the client application.

With the Credit_Details Web service, processing of the request involves validating the information that the user entered against the data in the data source. The data source includes the required information about the credit details of the user, such as the credit card number, the expiration date, and the credit limit. If the data is valid, then the result in the form of an XML message is transferred back to the client application and the user is allowedto shop on the Internet. Alternatively, if the data is not valid, an error message is returned. The working of a Web service is displayed in Figure.

Working of a Web Service

Working of a Web Service

The architecture and the working of a Web service are defined in the Web services model, as discussed in the following section.

The Web Services Model

The Web services model has the following features:

  • Three applications perform the roles of requesting the data, providing the application with the data, and registering the services.
  • These applications need to exchange data or interact with one another. The interactions involved in the Web services model are publishing, finding, and binding.
  • The preceding interactions are performed on the objects of the Web services model. These objects include the service and the description of the service. The following sections discuss these features in detail.

Applications in the Web Services Model

Table discusses the roles that the three applications in the Web services model perform.

Roles that Applications in a Web Service Perform

Roles that Applications in a Web Service Perform

Interactions in the Web Services Model

To access a Web service, the three applications discussed in the preceding section need to interact with one another. Table discusses the interactions that are involved in the Web services model.

Interactions in the Web Services Model

Interactions in the Web Services Model

Objects in the Web Services Model

The Web services model contains the objects or artifacts that are described in Table.

Objects in the Web Services Model

Objects in the Web Services Model

The Web services model is shown in Figure.

The Web Services Model.

The Web Services Model.

In addition to describing the architecture of a Web service, the Web services model defines the development life cycle (DLC) of the Web service.

DLC of a Web Service

The DLC of a Web service involves designing, developing, deploying, invoking, and managing the Web service. As discussed in the preceding section, the Web services model consists of three parts: service requestor, service provider, and service registry. All three parts of the Web services need to go through the phases of DLC. The following list discusses the phases in the DLC of a Web service in detail:

  • Design phase. The design phase of a Web service includes deciding the functionality and components of a Web service. Based on the design, the Web service is created in the development phase.
  • Development phase. The development phase includes writing and testing the code for the Web service. In addition, the service description of the Web service is written in the development phase.
  • Deployment phase.The deployment phase includes registering the Web service with the service registry. In addition, to make the Web service accessible to service requestor applications, you need to deploy the executable files in a Web service on a server.
  • Implementation phase. The implementation phase involves invoking the Web service. The service requestor application can find the required Web service and use the functionality provided.
  • Maintenance phase.The maintenance phase involves managing and administering a Web service after it is created and deployed. Maintenance of a Web service is essential to ensure that the Web service is available to requestor applications when required. In addition, the security and performance features of the Web service are monitored during this phase.

The different phases of the DLC are shown in Figure.

Phases in the DLC of a Web Service

Phases in the DLC of a Web Service



Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

XML Topics