Discussion:
Exposing my GWT API via web/RESTful service - can it be done (easilyish)?
Richard Berger
14 years ago
Permalink
Apologies in advance if I am not using the right terminology in
describing my question. English is my first language. But COBOL was
my first programming language :).

I am investigating using GWT/GAE for an upcoming project and one of
the requirements is that we provide an engine that will be used by our
GWT front-end as well as potentially being used by other clients -
perhaps over a web service (or a RESTful interface).

In creating the GWT application, one obviously has to define an API
between the "client side" and the "server side". This appears to be
precisely the API I would want to expose to others. It would also
seem to be redundant to have a second implementation of the API that
works with non-GWT front ends.

Thus, I am guessing there is a way to expose my GWT API to others.
More specifically, since I am using RequestFactory, I am talking about
exposing the methods defined in the RequestContext for each of my
entities (and implemented in the entity itself - at least as of GWT
2.1.0).

I have looked at the restlet project and it seems that that *might* be
what I need. But it's hard for an ex-COBOL programmer to know for
sure :).

Thanks in advance for your help!
RB
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
zixzigma
14 years ago
Permalink
I am interested in the very same thing.
So far my questions have left unanswered.
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/b86693200c8f3179

You can find similar thread here:
http://groups.google.com/group/gwt-platform/browse_thread/thread/39bbc24842168f6a

Based on my understanding,
some of the challenges for doing REST with GWT are:

1- JSON<->POJO conversion (especially for complex objects, maps,
polymorphic types)
on the client side (since GWT ends up as JavaScript, and there is
no Reflection support there)
2- Data Binding
3- URL handling etc


there are a number of third-party open-source projects
that provide libraries that one can put together to do REStul apps
with GWT.

However there is no unified framework, and no official solution/best
practice from Google.

I am afraid if you use the open-source tools, you might eventually get
your app working (RESTful),
but you have to deal with the risk of these tools not being around, or
being experimental or buggy,
also not being able to take advantage of many interesting features of
GWT 2.1
and down the road, Google Team going in one direction, you might be
left on your own with limited support.
and the skills you learn might not be transferable in another team/
company

recently with 2.1.1 Google team released AutoBean which seems to help
with JSON/POJO handling
however there are virtually no clear documentation and not even a
basic hello world sample of those.

I prefer REST over RPC/RequestFactory, because REST/JSON is universal/
service oriented
rather than binary (in case of RPC) and data oriented in case of RF.

RPC/RequestFactory somehow remind me of old days of Distributed
Objects/CORBA/DCOM
and I'm afraid sooner or later Google Team/Community might realize
this.

Lets say you want to host part of your app on Amazon EC2, and part of
it on GAE.
(GAE poses many restriction that one has to chose this approach),
and lets say you want to use a mature serverside framework such as
Spring for the back end.
(to take advantage of enterprise integration features it offers :
Spring Security etc)

GWT RequestFactory, ties the client to server,
they are decoupled through the use of Interfaces,
but so was CORBA/DCOM.
it might be de-coupled but not loosely coupled enough.

the entire point behind SOA was LooseCoupling.
but with GWT I have the feeling that we are going backwards instead of
forward.

GWT is rich and has many aspects.
Ofcourse I am not talking about the Compiler/Widget Library/Model View
Presenter,
my comment was mainly the Client/Server Communication mechanism.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Gal Dolber
14 years ago
Permalink
You can manage to use gwt's serialization with rest. Checkout this post:
http://timepedia.blogspot.com/2009/04/gwt-rpc-over-arbitrary-transports-uber.html
...
--
Guit: Elegant, beautiful, modular and *production ready* gwt applications.

http://code.google.com/p/guit/
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Sean
14 years ago
Permalink
I have used GWTRPCCommLayer with much success. I have my normal GWT App on
the web, and I also have a service running on my home PC that also calls
some of my RPC functions to find status, keep things updated, etc.,
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
zixzigma
14 years ago
Permalink
Two great open-source projects I came across today are:

RestyGWT
http://restygwt.fusesource.org/documentation/index.html

GWT-JSON-CommandPattern
http://code.google.com/p/gwt-json-commandpattern/

they are pretty straight forward with clean API.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Richard Berger
14 years ago
Permalink
Thanks to all for the feedback - just wanted to share some
reactions....
1. I was surprised by the lack of responses re: restlets - that seemed
to be a promising technology
2. Some of the suggestions/links seemed a little bit over my head -
but that is probably just because my head is at a pretty low place :).

But, pondering this a little more, I thought of a different approach
that might make a lot more sense. The bottom line is that my
application will need an API that can be called by many clients,
including the GWT UI that we would like to build. I was thinking of
trying to expose the Service API that is in the GWT application. But
wouldn't another approach be to build a RESTful interface to my data
as the API and then use that API from my GWT application (as there
seem to be standard ways of accessing REST APIs from the GWT server
side). Other apps could get to the REST API using whatever method
they chose and I don't have to end up implementing the API twice.

Thoughts and comments are definitely appreciated! Esp those using
short words :).

RB
RestyGWThttp://restygwt.fusesource.org/documentation/index.html
GWT-JSON-CommandPatternhttp://code.google.com/p/gwt-json-commandpattern/
they are pretty straight forward with clean API.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Konstantin Chvilyov
7 years ago
Permalink
Hi Richard,
Have you succeed?
Is it possible to add Swagger UI for existing GWT-RPC REST requests?
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Thomas Broyer
7 years ago
Permalink
Post by Konstantin Chvilyov
Hi Richard,
Have you succeed?
Is it possible to add Swagger UI for existing GWT-RPC REST requests?
There's no such thing as "GWT-RPC REST", so no.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Konstantin Chvilyov
7 years ago
Permalink
Thank you Thomas,
Is there such thing as "GWT-RPC POST" ?
If yes: Is it possible to add Swagger UI for existing GWT-RPC POST requests?

There's no such thing as "GWT-RPC REST", so no.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Jens
7 years ago
Permalink
Post by Konstantin Chvilyov
If yes: Is it possible to add Swagger UI for existing GWT-RPC POST requests?
No. You would need to make a REST API using the OpenAPI specification
(swagger) and let that REST API call your GWT-RPC services.

GWT-RPC isn't REST / JAX-RS.

-- J.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Loading...