Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to choose between JAX-RS and JAX-WS web services implementation?

In what contexts is it better to use one over the other and why?

Thanks!

like image 813
kgautron Avatar asked Aug 18 '11 14:08

kgautron


People also ask

What is the difference between JAX-RS and JAX-WS?

Actually,JAX-WS represents both RESTful and SOAP based web services. One way to think about it is that JAX-RS specializes in RESTful, while JAX-WS allows you more flexibility to choose between either, while at the same time being (in some cases) more complicated to configure. Thank you for simple explanation.

What is the difference between JAX-RPC and JAX-WS web services?

One of the main difference between JAX-RPC and JAX-WS is the programming model. A JAX-WS based service uses annotations (such @WebService) to declare webservice endpoints. Use of these annotations obviates the need for deployment descriptors.

Which of the following is an implementation of JAX-RS specification?

JAX-RS is a standard defined in Java Specification Request 311 (JSR-311) and Jersey / RESTEasy are implementations of it.

Is JAX-RS a web services technology?

JAX-RS is a JAVA based programming language API and specification to provide support for created RESTful Web Services. Its 2.0 version was released on the 24th May 2013. JAX-RS uses annotations available from Java SE 5 to simplify the development of JAVA based web services creation and deployment.


2 Answers

JAX-WS is an API for SOAP-based WS, and using it for RESTful WebServices is not the best way to go about things.

So if you're looking to implement a RESTful WebService, use JAX-RS .

like image 131
Mouna Cheikhna Avatar answered Sep 29 '22 05:09

Mouna Cheikhna


I feel like Web services are mostly tied for UDDI type applications. REST is just a plain evolution to make stateless http protocol to stateful thing by using http method communications for doing CRUD operations. Like mapping operations to methods GET, PUT, POST and DELETE.

Web Services are into coding for Airplane ticket reservation systems, Online banking, payment gateways, etc. Where there are a set of standard systems expose their API in some definitions. The JAX-RS is for providing some light weight layer for resources...

like image 36
Siva Tumma Avatar answered Sep 29 '22 04:09

Siva Tumma