JWS, JAX-WS, JAX-RS, REST, Restlet, SOAP related concepts, jwsrestlet

Source: Internet
Author: User
Tags what interface wsdl

JWS, JAX-WS, JAX-RS, REST, Restlet, SOAP related concepts, jwsrestlet

The J2EE technology related to WebServices is called JWS (Java WebServices), which includes technologies such as JAX-WS, JAX-RS, JAXB, JAXR, SAAJ, and StAX.
What supports SOAP is the JAX-WS, namely JSR 224, http://jcp.org/en/jsr/detail? Id = 224
What supports REST is the JAX-RS, that is, JSR 311, http://jcp.org/en/jsr/detail? Id = 311

Soap rest .. Reprinted: http://hi.baidu.com/itaolei/item/dd8e5f0fa6f1663bf3eafc99

This article is reposted from others' blogs. ArcGIS Server provides support for SOAP and REST interfaces (interface types may not be accurate, this article clearly compares the differences between SOAP and Rest!

REST seems to have emerged overnight, which may cause some controversy. Opponents can say that REST is the beginning of the WEB, but the principle that HTTP is born on the day of its appearance. But there is no doubt that REST is undoubtedly more favored in Web Service APIs with the same features released by network giants such as Google and Yahoo. Therefore, is it possible to say this: has RPC declined overnight?

The principle of the entire RPC is undoubtedly too huge in a small article of a job. Besides, RPC has no XML-RPC or extended SOAP in the Web Service field. The only important thing in principle is that the function calls and responses of traditional programs are replaced by requests and responses in RPC. In this case, it may be logical to describe SOAP before discussing REST.

What is SOAP?

SOAP (Simple Object Access Protocol), as its name implies, is a strictly defined information exchange Protocol used to encapsulate remote calls and responses into machine-readable formatted data in Web Services. In fact, SOAP data uses XML data format and defines a set of complex labels to describe the remote procedure, parameters, return values, and error information of a call. As the demand grows, no protocol should be added to support security, which makes SOAP very huge and deviates from the simple intention. On the other hand, each server can launch its own API based on this Protocol. Even if the services they provide and their similarity are different, the defined API is also different, which leads to the birth of WSDL. Web Service Description Language (WSDL) also follows the XML format to describe which server provides what Service, how to find it, and what interface specifications the Service uses. In short, Service discovery. Now, the process of using Web Service becomes to get the WSDL description of the Service, construct a formatted SOAP request according to the WSDL and send it to the server, and then receive a response in the same SOAP format, finally, the data is decoded based on the previous WSDL. In most cases, requests and responses are transmitted over HTTP, so the POST method of HTTP is used to send requests.

What is REST?

REST (REpresentational State Transfort) should be expressed as a virtual State machine in which the client requests resources to convert the State. Aside from the obscure theory in Dr. R. T. Fielding's thesis, REST should satisfy the following characteristics:

 

1) client and server structure;

2) The connection protocol is stateless;

3) the Cache mechanism can be used to improve performance;

4) hierarchical system;

5) On-Demand code.

In the end, REST is just an architectural style, not a protocol or standard. But this new style (maybe it has a long history ?) The impact on the existing Web Service represented by SOAP is also revolutionary, because it is designed for resources, and even services are abstracted as resources, because it is closely integrated with HTTP, because the server is stateless.

Differences between REST and SOAP

Because SOAP does not assume the underlying protocol for data transmission, it must be designed to run on various protocols. Even if most SOAP services run on HTTP and use URI to identify the service, SOAP only uses the POST method to send requests and uses a unique URI to identify the service endpoint.

For example, in a library online query management system, a service provider must provide an internal identifier for each book, and may define a listBooks operation to return a series of books and a getBook operation to return the specified books, A createBook operation is used to add new books to the database, and a deleteBook operation is used to delete obsolete books. Each operation has its own parameters, especially the books marked with internal identifiers. This design is criticized because the deleteBook operation also needs to be sent using the POST method. In fact, the HTTP protocol has a more logical DELETE method available. REST is designed in this way. REST specifies a unique URI for each resource (here it is a book, the four methods of HTTP, GET, POST, PUT, and DELETE, are used to visually obtain, create, update, and DELETE books. A library set is also a different resource from a single book. If/books is used to represent the book list and/books/ID to represent the books marked as IDS, the GET operation on/books indicates that the entire book list is returned, and the DELETE operation on/books/ID indicates that the specified book is deleted, and so on.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.