☰ See All Chapters |
SOAP vs REST
In this tutorial you will learn the differences between SOAP and REST. From architecture level to API level we have listed all the difference. It also provide the answer for the question, which one to use when?
SOAP | REST |
SOAP is a protocol. | REST is an architectural style. |
SOAP stands for Simple Object Access Protocol. | REST stands for Representational State Transfer. |
SOAP can't use REST service. | REST can use SOAP service. |
Always data transmission takes place in xml message body. | Data transmission can be done through URL and message body. |
JAX-WS, JAX-RPC are the java API for SOAP web services. | JAX-RS is the java API for RESTful web services. |
To intercept message we have to use soap handlers. | To intercept message we have to servlet filters. |
Since jax-rpc is deprecated, SOAP API JAX-WS supports only JAXB | Supports both JAXB and JAXP. |
URL always ends with ?wsdl | URL not ends with ?wsdl |
JavaScript can call SOAP, but it is difficult to implement. | Easy to call from javascript. |
SOAP defines its own security. | RESTful web services inherits security measures from the underlying transport. |
SOAP permits XML data format only. | REST permits different data format such as Plain text, HTML, XML, JSON etc. |
SOAP is less preferred than REST. | REST more preferred than SOAP. |
All Chapters