The Java EE 6 Tutorial, Volume I

Deciding Which Type of Web Service to Use

Basically, you would want to use RESTful web services for integration over the Web and use Big web services in enterprise application integration scenarios that have advanced QoS requirements. This topic is discussed in more detail in the following sections.

Note –

For an article that provides more in-depth analysis of this issue, see RESTful Web Services vs. “Big” Web Services: Making the Right Architectural Decision by Cesare Pautasso, Olaf Zimmermann, and Frank Leymann from the WWW '08: Proceedings of the 17th International Conference on the World Wide Web (2008), pp. 805-814.

When Should I Use JAX-WS?

JAX-WS addresses advanced quality of service (QoS) requirements commonly occurring in enterprise computing. When compared to JAX-RS, JAX-WS makes it easier to support the WS-* set of protocols (which provide standards for security and reliability, among other things) and interoperate with other WS-* conforming clients and servers.

When Should I Use JAX-RS?

When compared with JAX-WS, JAX-RS makes it easier to write applications for the web that apply some or all of the constraints of the REST style to induce desirable properties in the application like loose coupling (evolving the server is easier without breaking existing clients), scalability (start small and grow), and architectural simplicity (use off-the-shelf components like proxies, HTTP routers, or others). You would choose to use JAX-RS for your web application because it is easier for many types of clients to consume RESTful web services while enabling the server side to evolve and scale. Clients can choose to consume some or all aspects of the service and mash it up with other web-based services.