What Are Web Services?
The name itself describes a lot, ‘Web + Service‘, which means the service which are available on the web. To go back a little into the past, there was a time the IT industry was finding a way to communicate with each other, when the leaders in the IT industry such as IBM, Sun, Microsoft and several others came up with the web services concept that made things feasible in exchanging services, information and products. In simple words, a web service is a piece of software available on the web that uses HTTP and XML messaging system, which clearly implies that it is not bound to any specific operating system or programming language. Hence, Web services provide a standard means of inter-operating between software applications running on a variety of platforms and frameworks.
Among the benefits that Web Services brought with itself, some of them are:
- Low cost of communication
- Standardized protocol
- Loosely coupled applications can communicate with each other
- Re-usability of the functionality via web by any another application
- Simple services can interact with each other to deliver sophisticated added-value services.
- Web services use XML to code and decode the data, and SOAP is the one responsible for transporting it from one end to another.
On a high level, something like the following happens:
Components of the Web Services:
The basic Web services platform is XML + HTTP. All the standard Web Services work using following components:
- SOAP (Simple Object Access Protocol) – protocol which decides the format in which the data is to be sent and received. It encodes and decodes different message formats into a standardized SOAP message.
- UDDI (Universal Description, Discovery and Integration) – a mechanism to register and locate web service applications.
- WSDL (Web Services Description Language)
UDDI is a directory service mechanism, where the WSDLs get registered and published.
There is a SOAP, which is an XML based protocol that helps in exchange of information via HTTP. With every SOAP request that gets hit, UDDI first prompts where the web services are, while returning the WSDL describing the selected web service. The below flowchart explains it all:
Let’s list out the events depicted in the above diagram:
- Search UDDI site for the proper web service.
- Description of the selected web service is returned to the client application in the form of the WSDL file.
- A local proxy to the remote service is created. The proxy converts an object means of method invocation into an XML message, and vice versa.
- A SOAP/XML message is in turn created and sent to the URL specified in the respective WSDL file.
- The SOAP listener at the host site receives the call and interprets it for the Web Service.
- The Web service performs its function, and returns the result back to the client, via the listener and the proxy.
Types of Web Services:
- SOAP Based Web Services
- RESTful Web Services
Some important takes on WEB SERVICES:
1. If there is some method in C++ that you want to use in JAVA, expose the C++ method as a web service.
2. One of the best feature of Web Service is the inter-operability, which means – A java code can make a call to a .Net web service, or a .Net code can make a call to a Java web service.
3. Among the two types of web services: SOAP and REST, SOAP is the one that came first.
I hope you all got the least idea of what a web service is.