On Tuesday, July 3, 2012 11:24:17 AM UTC+2, chalu wrote:
Please have anyone of you been successful with REST on a GWT project? What api's did you use. We are in the design stage of an app, we love GWT but want to liberate the architecture such that we can use the same server code for the clients (GWT and JQuery mobile). I don't know if RequestFactory (for the GWT client) can play nicely with a REST back end and we are not even sure how to go about it.
RequestFactory is inherently RPC-oriented, so no it won't "play nicely with a REST backend".
On the client side, it comes with 2 "dialects": RequestFactory's own protocol (to talk to the RequestFactoryServlet), and JSON-RPC (to talk to any JSON-RPC endpoint). You could use that second one to ease reuse of the same endpoints by other clients (there probably is a jQuery plugin for that).
However, the JSON-RPC dialect is not really finished yet (some limitations for now) but should nevertheless be usable (I believe Google is using it). You'll lose some features too, compared to the RF dialect (everything related to EntityProxy vs. ValueProxy; basically, only use ValueProxies).
Some googling revealed Restlet (which I think couples our server code to GWT)
Not at all.
Restlet was created long before GWT, and they then added GWT support on the client-side, but the goal is to be a truly RESTful framework, where it doesn't matter what your clients and servers are, only what resources they expose, with which representations, and responding to which verbs.
Put differently, anything that would bind your client and server cannot be said to be RESTful. If you want to make true "REST resources", then look for something else (Restlet for example, or JAX-RS)
and Apache CXF.
I don't know Apache CXF so I can't comment.
There's also JAX-RS to easily build REST endpoints.
Any hint on which to use, and how to go about it? Big thanks.
May I question whether you want to make a "true" REST backend, or simply don't want to be tied to any "proprietary protocol"? that would open a bunch of possibilities, such as JSON-RPC.