You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by James Strachan <ja...@gmail.com> on 2008/11/24 11:44:45 UTC

Re: GWT RPC Servlet Endpoint

2008/11/22 Gary Struthers <gs...@berkeley.edu>:
> GWT subclasses Servlet to transform parameters for RPC. What approach would
> you recommend for consuming requests from a GWT client? Start a route from
> within the GWT Servlet? Or somehow make a GWT Servlet an Endpoint?

The GWT RPC mechanism is a bit of a black box really; it does its own
serialization/marshalling that you probably don't want to mess with
its internals.

So I'd either recommend

(i) implement the GWT RPC server (servlet) then fire messages into
Camel where you want to. You could delegate to a client side stub
generated using the @Produce annotation...
http://activemq.apache.org/camel/pojo-producing.html

to avoid having any Camel specific APIs in your code; you could just
delegate to the GWT interface.


(ii) use a REST client on the GWT client to use regular HTTP
operations; then use regular REST/HTTP components on the server side
using Camel.

e.g. in GWT you can make HTTP invocations directly...
http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=DevGuideHttpRequests

There's also this library to help but I've found the standard
RequestBuilder/Request code in GWT to be fine
http://code.google.com/p/gwt-rest/

(iii) I guess we could figure out how to write a generic GWT-RPC
servlet which delegates all method calls to some endpoint in Camel; am
not sure how easy/hard that'd be as I've never tried tinkering inside
the GWT RPC mechanism.

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/