Featured Post

soap vs reset in short lines


SOAPREST
Supports XML onlysupports text,json and XML
Supports SMTP and HTTP all protocolssupports HTTP only
Secure as it supports WS-Securityas long a it is on wire , secure once delivered not secure
Supports ACID and 2phase commit for long lived txnsno txn support ACID or two phase commit


There are many differences between SOAP and REST web services. The important 10 differences between SOAP and REST are given below:
  1. SOAP is a protocol. REST is an architectural style.
  2. SOAP stands for Simple Object Access Protocol. REST stands for REpresentational State Transfer.
  3. SOAP can't use REST because it is a protocol. REST can use SOAP web services because it is a concept and can use any protocol like HTTP, SOAP.
  4. SOAP uses services interfaces to expose the business logic. REST uses URI to expose business logic.
  5. In Java JAX-WS is the java API for SOAP web services. In Java JAX-RS is the java API for RESTful web services.
  6. SOAP defines standards to be strictly followed. REST does not define too much standards like SOAP.
  7. SOAP requires more bandwidth and resource than REST. REST requires less bandwidth and resource than SOAP.
  8. SOAP defines its own security. RESTful web services inherits security measures from the underlying transport.
  9. SOAP permits XML data format only. REST permits different data format such as Plain text, HTML, XML, JSON etc.
  10. SOAP is less preferred than REST. REST more preferred than SOAP.

REST(REpresentational State Transfer)
REST is an architectural style. It doesn’t define so many standards like SOAP. REST is for are exposing a public API over the internet to handle CRUD operations on data. REST is focused on accessing named resources through a single consistent interface.
SOAP(Simple Object Access Protocol)
SOAP brings it’s own protocol and focuses on exposing pieces of application logic (not data) as services. SOAP exposes operations. SOAP is focused on accessing named operations, each implement some business logic through different interfaces.
Why Rest?
  • Since REST uses standard HTTP it is much simpler in just about ever way.
  • REST permits many different data formats where as SOAP only permits XML.
  • 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.
  • If security is not a major concern and we have limited resources. Or we want to create an API that will be easily used by other developers publicly then we should go with REST web services.
Why SOAP?
  • WS-Security: While SOAP supports SSL (just like REST) it also supports WS-Security which adds some enterprise security features.
  • WS-AtomicTransaction: Need ACID Transactions over a service, you’re going to need SOAP.
  • WS-ReliableMessaging: Rest doesn’t have a standard messaging system and expects clients to deal with communication failures by retrying.
  • SOAP is highly secure as it defines its own security.
  • If the security is a major concern and the resources are not limited then we should use SOAP web services. Like if we are creating a web service for banking related work then we should go with SOAP as here high security is needed.

Comments

Popular posts from this blog

[Inside AdSense] Understanding your eCPM (effective cost per thousand impress...