In the last post, we learnt about the differences between API and Webservices. In this post, we will learn about the types of Webservices with SOAP Webservices in detail.
A Webservice needs the following entities to perform its operations:
1) Communication Medium
2) Messages Format
Webservices are basically of 2 types:
SOAP is an earlier form of webservice whereas REST is relatively new form of webservice introduced in favor of simplicity and speed.
1) SOAP stands for Simple Object Access Protocol. It was originally developed by Microsoft to replace older technologies that don’t work well on Internet such as DCOM and CORBA. It uses HTTP as communication medium (other protocols can also be used such as SMTP) and SOAP as message format. SOAP format is nothing but a standardized XML defining which content should go inside which node (envelope,body etc). One of the most important SOAP features is built-in error handling. If there’s a problem with the request, the response contains error information that can be used to fix the problem. This particular feature is extremely important in cases where user doesn’t generally own the service; otherwise debugging would be nightmare.
As told in the previous post, an application providing access to a service is called a service provider and the application using the service is called service consumer. To connect to a SOAP Webservice, some information is required (such as functions exposed by the service, port number on which service is accessible etc). Service Provider captures the required information in a XML file called WSDL (Web Service Description Language). There are 2 ways by which consumer can get the WSDL file to connect to particular Webservice provider.
a) Either consumer can get the WSDL file/URL directly from the provider
b) Consumer can get the WSDL file/URL from UDDI (Universal Directory for WSDL)
For second point, it is necessary for service provider to register the Webservice in UDDI using WSDL. UDDI (Universal Description, Discovery, and Integration) is an XML-based registry for businesses worldwide to list themselves on the Internet.
Below is the diagrammatic description of SOAP Webservices:
In the next post, we will learn about another type of Webservice (REST).