users@jersey.java.net

Jersey Client/Server WADL

From: Alan O'Leary <alanoleary_at_gmail.com>
Date: Mon, 27 Apr 2009 10:21:56 +0100

Hello,
   I am about to embark on a project heavily using Jersey for RESTful
client/server interaction. One main features is that the server
(Spring/Jersey/GF) will support a number of different RESTful clients. One
of the primary clients is a Swing application.. I would like to share/reuse
as much code as possible in my application so would really like to use
Jersey to serve the Swing Client along with other JSON clients (GWT/etc)
rather than having a bespoke API. I have a couple of questions regarding
"best practice"/ tools...

1: I would like to have a shared project that contains the JAX-B annotated
JavaBeans to model the "representational state" of my server info. This will
drive the WADL/model supported by the server. What is the best way for me to
"auto-generate" my client stubs in this scenario so that my swing
client/server stay in lock-step - and more importantly is there any example
of this ? I have looked through the extensive Jersey samples but did not see
much on the client side of things in terms of code generation.

2: Is this a "sane" approach ?

3: Versioning - Is there a recommended way to handle versioning of the API
at the moment ? I have done a bit of reading and like the "out-of-band"
approaches the best (accept header approaches) - but wondering if anyone has
any recommendations/experiences.

Thanks in advance
Regards
-A-