Follow up question to this post:
For now I have a slight idea about the differences between SOAP and RESTful Services.
My question is when I should use SOAP, and when I should use RESTful; which one is "better" when it comes to performance/speed or request handling?
I'm implementing for the first time in RESTful(java) and I want know more about it; I've dealt with SOAP before.
SOAP web service always make a POST operation whereas using REST you can choose specific http methods like GET,POST,PUT,DELETE. Example: to get an item using SOAP you should create a request xml but in the case of REST you can just specify the item id in the url itself.
REST stands for Representational State Transfer where as SOAP stands for Simple Object Access Protocol.
SOAP defines its own security where as REST inherits security from underlying transport.
SOAP doesnot support error handling but REST has built-in error handling.
REST is lightweight and does not require XML parsing. REST can be consumed by any client, even a web browser with Ajax and Javascript. REST consumes less bandwidth, it does not require a SOAP header for every message.
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 has no WSDL[Web Description Language] interface definition.
REST is over HTTP, but SOAP can be over any transport protocols such as HTTP, FTP, SMTP, JMS etc.
Rest VS SOAP
SOAP:
► SOAP is simple object access protocol that run on TCP/UDP/SMTP.
► SOAP read and write request response messages in XML format.
► SOAP uses interface in order to define the services.
► SOAP is more secure as it has its own security and well defined standards.
► SOAP follows RPC and Document style to define web services.
► SOAP uses SOAP-UI as client tools for testing.
REST
► REST is representational state transfer that uses underlying HTTP protocols.
► REST is stateless.
► REST is an architectural style that is used to describe and define web services.
► REST can read and write request response messages in JSON/XML/Plain HTML.
► REST uses URI for each resource that is used in web service.A resource can be image text method etc.
► REST uses set of VERBs like HTTP's GET, POST, PUT, DELETE.
► REST is easy to develop and easy to manage as compared to SOAP UI.
► REST has light weight client tools or plugins that can easily be integrated inside browser.
► REST services are cache able.
Difference between Rest and Soap