Original address: Smurfs--silently upstream
Notes:
SOAP and REST are two of the main scenarios for implementing WebService (Web API deployment REST seems to take up half of the total)
- REST Web Services based on HTTP protocol
- SOAP Web Services supports multiple transport protocols: HTTP, SMTP, MIME, etc.
Java Development WebService the two most important specifications:
- JSR-224 (jax-ws: Java API for xml-based Web Services), mainly using the SOAP protocol, using WSDL to describe;
- JSR-311 (jax-rs: The Java API for RESTful Web Services), using the WADL description;
the difference between REST and SOAP :
- Rest assigns a unique URI to each resource, sending the request in 4 ways of http:get, POST, PUT, delete visually represent get, create, update, and delete.
- SOAP only uses the Post method to send requests, identifying the portal of the service with a unique URI. (because SOAP does not assume a lower-level protocol for transmitting data, it must be designed to run on a variety of protocols.) Even if the vast majority of soap is running on HTTP, use the URI to identify the service. The criticism of this design is that the delete operation is also sent using the Post method, whereas the HTTP protocol has a more and more logical Delete method available. )
ruler length short:
Rest Benefits: Rest is simple and intuitive , using the HTTP protocol to the limit.
SOAP: complex requirements devastate ease of use.
In the final analysis, no one is omnipotent.
- Rest uses WADL to describe the rest interface. WADL is like the rest version of WSDL , where the shadow of soap is everywhere as rest is applied to complex fields.
- In fact, some Web service providers provide rest APIs that are only the rest of the shell, and the transmitted requests and responses are completely simplified soap.
"No technology can solve all problems once and for all, but it is sufficient to gracefully solve the problem in the field under the predetermined constraints."
The introduction of a new technology has always attracted countless follow-up and flattery, only when the dust settles down to get a fair evaluation. ”
Learning WebService The second step: Knowledge preparation--soap vs REST (WSDL and Wadl differences) (RPM)