Search Your Question

Difference between SOAP and REST

Ans : 

1. Requests sent via REST tend to be much lighter than SOAP. Because of this, applications don't require much bandwidth to use REST web services over SOAP.

2. REST is good when working with web services open to the public, but if security is required, then the SOAP API is better to use. 

3. SOAP permits XML data format only while REST permits Plain text, HTML, XML, JSON etc.

i.e 

Suppose we want to retrieve today's weather report from a server which is providing weather information, your RESTful URL will look something like http://weatherdata.org/data/weather/uk/london (Not real link just example url), which is very similar to HTTP request like http://weatherdata.org/data/weather?q=uk,London.

On the other hand, in order to get the same data using SOAP, you need to create an XML message with header and body and send it http://www.webservicex.net/globalweather.asmx?op=GetWeather

In short, RESTfull web services are much simpler, flexible and expressive than SOAP web services in Java.

No comments:

Post a Comment

Thanks