Web services are self-contained, modular business functions – or applications – that operate over the Internet. Web service is a way of communication that allows interoperability between different applications on different platforms, for example, a java based application on Windows can communicate with a .Net based one on Linux. They do so in two fundamental ways – messaging format and protocol independence.

  • First, web services applications use XML as the common messaging format which is widely supported by software technologies.
  • Second, web services are protocol independent – the same XML message can be transferred via more than one transport protocol.

Web Services have Two Types of Uses :

  • Reusable application-components.
  • Connect existing software.

There are primarly 2 different types of webserice:

  • SOAP  – Java specification for this is JAX-WS
  • REST – Java specification for this is JAX-RS

SOAP stands for Simple Object Access Protocol. REST stands for REpresentational State Transfer.

REST is almost always going to be faster. The main advantage of SOAP is that it provides a mechanism for services to describe themselves to clients, and to advertise their existence. REST is much more lightweight and can be implemented using almost any tool, leading to lower bandwidth and shorter learning curve. However, the clients have to know what to send and what
to expect. In general, When you’re publishing an API to the outside world that is either complex or likely to change, SOAP will be more useful. Other than that, REST is usually the better option.

REST permits many different data formats where as SOAP only permits XML. While this may seem like it adds complexity to REST because you need to handle multiple formats, in my experience it has actually been quite beneficial. JSON usually is a better fit for data and parses much faster. REST allows better support for browser clients due to it’s support for JSON.

REST has better performance and scalability. REST reads can be cached, SOAP based reads cannot be cached.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: