Why Google uses a lot of SOAP in spite of the following advantages in REST.
REST is an architectural style. REST stands for REpresentational State Transfer. REST can use SOAP web services because it is a concept and can use any protocol like HTTP, SOAP. REST uses URI to expose business logic. REST uses (generally) URI and methods like (GET, PUT, POST, DELETE) to expose resources. JAX-RS is the java API for RESTful web services. REST does not define too much standards like SOAP. REST requires less bandwidth and resource than SOAP. RESTful web services inherits security measures from the underlying transport. REST permits different data format such as Plain text, HTML, XML, JSON etc. REST more preferred than SOAP. REST is an architectural style, unlike SOAP which is a standardized protocol. REST follows stateless model REST has better performance and scalability. REST reads can be cached. JSON usually is a better fit for data and parses much faster No accepted standard for a JSON schema. SOAP
SOAP is a protocol. SOAP stands for Simple Object Access Protocol. SOAP can't use REST because it is a protocol. SOAP uses services interfaces to expose the business logic. JAX-WS is the java API for SOAP web services. SOAP defines standards to be strictly followed. SOAP requires more bandwidth and resource than REST. SOAP defines its own security. SOAP permits XML data format only. SOAP is less preferred than REST. SOAP is actually agnostic of the underlying transport protocol and can be sent over almost any protocol such as HTTP, SMTP, TCP, or JMS. SOAP has a standard specification SOAP has specifications for stateful implementation as well. SOAP based reads cannot be cached. The marshalling costs are higher but one of the core advantages of XML is interoperatibility. For XML, a schema allow message formats to be well-defined. Data typing and control is also much richer under XML. Thanks in advance.
Steve Francia has a great comparison article on the subject, though I was under the impression (and Steve mentions) that Google had moved away from SOAP to REST. I would be curious if you are asking about a specific API? Then maybe I could formulate a more specific answer regarding that API.
However, overall, while REST is superior in almost every way, here is why you would use SOAP:
Web Service Security - SOAP supports WS-Security
in addition to SSL, which adds some enterprise security features and identity through intermediaries, not just point to point (SSL). It also provides a standard implementation of data integrity and data privacy.
Web Service Atomic Transaction - WS-AtomicTransaction
s are necessary if you need Transactions that are ACID compliant (though probably not why Google would have been using it).
Web Service Reliable Messaging - SOAP has standard messaging through WS-ReliableMessaging
, enabling built in successful/retry logic and provides end-to-end reliability even through SOAP intermediaries.
链接地址:
http://www.djcxy.com/p/12368.html
上一篇:
如何使用JavaScript检查URL中的#hash?
下一篇:
尽管REST具有以下优势,为什么Google仍然使用大量的SOAP?