Home ProgrammingJava Web Services – History, Introduction and SOAP vs REST

Web Services – History, Introduction and SOAP vs REST

by Log Raj Bhatt

What are Web Services?

Web services are open standard based web applications that interact with other web application for the purpose of exchanging data. Web services allow the communication between two applications on network independent of the technology used i.e. a java web application can communicate with a python web program via web. The program consuming web service is a Web service client program.

Generally, we access web applications from web Browser which is normal web client, but Web Services are supposed to be accessed from another web application. Web application provide data to users in nice and human readable form(HTML) with styles and scripts. But Web service return just bare data in xml or json format because client program using web service prefer to consume just data.

Web ServicesAdvantages of Web services:

Web services exchange data in xml or json format which are very lightweight and universally supported
In web services also data exchange happen under HTTP which is an reliable, established and secure protocol.
Soap protocol is xml based messaging protocol which is standard as well as cross platform.
We can publish our web services very easily using uddi.
New Language called Web Service Description Language is used to describe behaviour of web services which contain the structure of input request and output response.

History of Web Services

Its history starts from inter-process communication in which two processes running on a system exchange information between each other. Inter-process communication is achieved using pipes and shared memory and com (Component object model). After that it extended to LAN where two processes in separate machine in a network exchange data with help of DCOM, RPC and sockets. But it was not possible to exchange data between processes if architecture of system is different because of the different data representation techniques. To solve this issue XDR(External Data Representation) format evolved which specified the common standards for data representation.

After a lap now we are exchanging data in the processes separated by internet using http protocol. As the LAN evolved to internet and web the XDR is evolve into the XML. XDR was binary format and now XML is text format but both are same by nature of working. Eventually SOAP protocol evolves to achieve communication between applications on internet. And now REST architecture is on the top of every technology.

Types of web services:

There Mainly two types of web services.
These are SOAP web service and Rest Web Service. I will explain about all these in next article. Here I want to give a brief differentiation between SOAP and Rest services.


Difference 1:

Soap is an standard Messaging protocol used by web services to exchange data. This means SOAP is a protocol. But REST is not a protocol. Rest is an architectural style or a concept to make web services. In both type of web services information, HTTP protocol is responsible to transport data. But In Soap web service a SOAP request comes inside HTTP packet and SOAP response goes in HTTP payload. As we know REST is only concept, we can make the RESTful web services using SOAP as messaging protocol. The web service that follow all the specification of REST web service is called RESTful web service.

Difference 2:

Full form of the SOAP is Simple Object Access Model although full form of REST is REpresentational State Transfer.

Difference 3:

JAX WS is the name of java API used for creating SOAP web service whereas JAX RS java API is for creating RESTful web services.

Difference 4:

Soap has very standard and strict rules to prepare request and response where as RESTful web services can use any custom protocol. Therefor SOAP only support XML but REST support JSON also. Hence SOAP request and responses may be heavier than that of REST since XML format takes more space than JSON. Therefor we can say SOAP consume more bandwidth and REST Service calls take less bandwidth.

Difference 5:

Because of the Own standard protocol SOAP has its own security features.

Difference 6:

Main and significant difference between soap and REST is the tight copulation of SOAP web service with client. WSDL file describe the SOAP web service and Client make SOAP service call using WSDL file. So whenever there is change or update in Web service then client should be acknowledged so that client can change as per service. But REST ful web services are URI based. So change in the RESTful web services do not matter for client Because change in service do not change URI. The only thing that client have, to call a REST WEB service is resource URI. It is the root cause of popularity of REST web services.

Difference 7:

REST is easy to implement and faster because it use different methods of HTTP. So server may use caching for get methods and which can increase the speed of web service.

That’s all for Now. Please get notification on from blog. We will entertain you with more useful Articles. Please do suggest and comment.