views:

940

answers:

4

What do you think is the advantages/disadvantages between this two libraries? Which of these two are best suited for production environment? By the way I will be using JSON instead of XML.

I also would like to know what library is most supported by the community e.g. tutorials, documentation.

+1  A: 

I have only used Jersey (with great satisfaction) so I cannot give a real comparison. Things you might want to consider:

  • CXF is packaged up with SOAP stack support so you bring in a lot of SOAP-related weight you'll never use when you build a RESTful system. (There are plans to split the packaging as far as I know, though)
  • Jersey comes with a number of non-standard additions to JAX-RS that are very helpful. There is also a client side core framework which is designed quite nicely.
  • [Warning: Shameless plug ahead (sorry)]: I have been working on an extended Jersey client side framework that encourages proper use of REST on the client side and is (IMHO at least) very natural to use. It is planned to announce it this (or next) week - if you care about the client side a lot, give it a try. Personally, I'd consider that a huge pro-Jersey argument.

HTH,

Jan

Jan Algermissen
Regarding your shameless plug, where might I find some documentation/information/etc. on it that I might be able to give it a whirl?
Nick Klauer
Nick, I am just typing the introductory blog post. Paul Sandoz is planning to make some final repository changes this morning. Once that is done, we'll go public. You will find the blog at http://nordsc.com/blog/ (hopefully this afternoon).
Jan Algermissen
Nick, here you go :-) | Jersey client side framework: http://www.nordsc.com/blog/?p=439
Jan Algermissen
+3  A: 

I have used both, but for different purposes. CXF worked great to parse a WSDL and create Java POJOs to interact with, so CXF is pretty good for client-side WSDL services. I'm currently using Jersey for server-side implementation and I am impressed with the simplicity of getting up-and-running with RESTful services using Jersey.

As Jersey is mainly devoted to RESTful services and CXF deals mostly (all?) with SOAP, I think it comes down to whether you want to work with SOAP or REST, and determine the best framework for the job from there. Personally, I am more in the REST camp than SOAP, but my needs are different. Should I be in a situation where the vendor/customer/company I write the service for needs some sort of contract, I might still push for REST (and REST's equivalent for contract-based services, WADL), but would likely be required to implement a SOAP service, in which case I would look at CXF first and everything else second.

Personally, Jersey is pretty good for a JAX-RS framework, although don't exclude RESTEasy, by JBoss. I like both, but the documentation for RESTEasy is better.

For CXF, the documentation is OK, but I ran into inconsistencies in how I needed to handle SSL and HTTP Proxies, but it worked itself out eventually. CXF does provide more out of the box regarding these additional features, and I would say RESTEasy would provide the equivalent functionality for RESTful frameworks.

Nick Klauer
+3  A: 

Did you consider RESTlet? It is a powerful package to quickly build RESTful web services. The people behind RESTlet also write the RESTlet In Action book which is currently in early access. The chapters that are already available do a very good job of explaining REST and detailing how you go about designing a REST api.

dafmetal
A: 

I've used CXF for JAX-WS and Jersey for JAX-WS so I can't comment about CXF and REST. It was easy to set up a REST example using Jersey. The documentation was adequate. I haven't used RESTEasy but Jersey looks to have more traction and more recent updates.

A good book for implementation guidelines is RESTful Web Services Cookbook.

Blair