41

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

Thanks!

skaffman
  • 398,947
  • 96
  • 818
  • 769
kgautron
  • 7,915
  • 9
  • 39
  • 60

3 Answers3

18

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 .

Mouna Cheikhna
  • 38,870
  • 10
  • 48
  • 69
  • 1
    it looks like JAX-RS 2 is contained in JAX-WS. see http://jax-rs-spec.java.net/nonav/2.0/apidocs/index.html . what do I make of this? – Janus Troelsen Jul 26 '13 at 11:28
5

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...

Siva Tumma
  • 1,695
  • 12
  • 23
0

Jax-WS supports both SOAP and ReST, however if you need the features of the WS* protocols, JAX-WS is the right API. Due to this JAX-WS is somewhat complex to use in comparison to ReST.

nkrust
  • 1
  • 1