Creating a web service is not dependent on any programming language, meaning that you could use any language or tool for creating a web service. But there are some components that are common to all web services. We will review these common components in the following section.
Roles in Web Services
We can identify the following roles in any Web Service:
A service Provider: this is who provides the web service; it is responsible for implementing the service and making it available over a network.
A service Requestor: this is who consumes the web service. It is responsible for connecting to the web service by means of a network connection and sending appropriate XML requests.
A Service Registry: this is a centralized directory of services; it provides a central place to allow developers to publish new services and to find a previously existing service so they could use it.
Web Services Protocol Stack
Any web service currently has at least four layers, a service transportation layer, a messaging layer, a service description layer and a service discovery layer.
The service transport layer: it is responsible for the transportation of any given message between the involved applications. Many of the current web services use HTTP (HyperText Trasfer Protocol) as the transport protocol, but there are many mores that could be used. For instance you could use SMTP (Simple Mail Transfer Protocol), FTP (File Transfer Protocol) among others.
The messaging layer: it is responsible for the encoding of messages using common XML (eXtensible Markup Language). This format allows creating messages that can be understood at both ends, so much as the Requestor side or as the Provider site. We will be focusing on SOAP as the protocol for this layer.
The service description layer: it is responsible for the description of the interface exposed by the web service. We will be focusing on WSDL (Web Service Description Layer).
The service discovery layer: it is responsible for the centralization of services in a common registry and for providing simple publication functionality. This is mainly handled by UDDI (Universal Description, Discovery and Integration).
Layers of a Web Service
Any web service has two main layers:
• Listener layer
• Business layer
These two layers within the internal structure of a Web service cooperate to allow different applications to interoperate between each other.
The Listener Layer
This layer is the one that is exposed in a Web service and is closest to the client application. In the web service process, when a client application stablishes a communication with the Web service provider application, it is initialized by sending a request to the listener layer of a Web service.
This layer interprets the request from the client application and allows the Web service provider application to understand what was requested. Once it is received, the request is forwarded to the next layer in the architecture.
In the response process, once the request for the data is processed, the result is then returned to the listener layer, this layer converts the response data into a form that the client can understand.
The Business Layer
This layer implements the business logic of the web service, like verifying a subscriber available credit, or checking what catalog is available for a subscriber.