27

I am working on a project that involves mobile and web clients with Google's AppEngine PAAS. I would like to use RESTFul webservices with my AppEngine app.

I have looked over Stackoverflow for references to RESTFul service frameworks that can be used with AppEngine for both web (GWT) and mobile (Android) clients. Although Restlet seems to provide editions for AppEngine, GWT and Android, so far I've got it down to RestEasy mostly due to this question.

There have been questions previously that discuss RESTFul frameworks but I don't think the comparisons apply well to this, now quite common, case. It would be helpful to hear experienced developers' views on the frameworks available for this set of platforms and merits versus demerits of each.

Community
  • 1
  • 1
Saad Farooq
  • 12,612
  • 9
  • 64
  • 94
  • I've been happily using RestEasy on AppEngine for most of a year. – Riley Lark Feb 26 '12 at 23:57
  • I've been using Restlet on App Engine, GWT, and Android for about 6 months. See my answer here (http://stackoverflow.com/questions/9348616/restful-webservices-on-google-app-engine/9352079#9352079) for some details. – Andy Dennie Feb 27 '12 at 13:06
  • Also, the Restlet guys recent published a roadmap for their future activities, which might influence your evaluation. See http://blog.restlet.com/2012/02/25/the-road-ahead-from-noelios-to-restlet/ – Andy Dennie Feb 27 '12 at 13:13
  • I've heard Jersey is good if your going the java route. – aglassman Mar 08 '12 at 14:53
  • @RileyLark So you have worked with RestEasy and AppEngine, would you mind if you can help me on my issue with resteasy on app engine: http://stackoverflow.com/questions/9629028/resteasy-with-google-app-engine – quarks Mar 09 '12 at 12:22
  • After toiling with RESTLet for a while I have to agree that it is really bad... ran into problems that seem to have no solution and other questions on SO also got the same advice. – Saad Farooq Jul 18 '12 at 09:35

5 Answers5

37

You might wish to consider using Google Cloud Endpoints, which was announced as a trusted tester feature for App Engine at Google I/O, and is now available to everyone. With Endpoints, you annotate simple Java (or Python) classes and methods to describe your API. For example, this is a simple class to get and retrieve a list of high scores from a Tic Tac Toe game:

@Api(name = "tictactoe")
public class ScoreEndpoint {
  @ApiMethod(name = "scores.get")
  public Score get(@Named("id") String id) {
    PersistenceManager pm = getPersistenceManager();
    Score score = pm.getObjectById(Score.class, id);
    pm.close();
    return score;
  }

  @ApiMethod(name = "scores.list")
  public List<Score> list() {
    PersistenceManager pm = getPersistenceManager();
    Query query = pm.newQuery(Score.class);
    return (List<Score>) pm.newQuery(query).execute();
  }
}

Features

  • Support for Java and Python runtimes
  • Built on Google's API infrastructure - it works with many of the same tools and libraries used for Google's own APIs, such as the APIs Explorer and APIs Console
  • Automatically-generated, statically-typed client libraries for Android and iOS - these libraries are using the same Google-authored Java and Objective-C libraries you would use to access other Google-provided APIs such as the Calendar API
  • Dynamically-typed JS client library - again, the same library you use to access other Google-provided APIs in JS
  • Built in support for OAuth 2
  • Integration with the Google Plugin for Eclipse - this allows you to automatically create an API based on a model, or an App Engine application to back an existing Android app
  • Support for local development - you can build and test your API using the App Engine development environment, just as with other App Engine features

Learn More

Check out the documentation for more details on using Endpoints.

You can also watch several talks from Google I/O:

Dan Holevoet
  • 9,175
  • 1
  • 31
  • 47
2

I've been using spring restful services with lots of luck on GAE and have been consuming it with Android Native, Phonegap and IOS clients with no issues whatsoever.

http://blog.springsource.org/2009/03/08/rest-in-spring-3-mvc/

DavidB
  • 1,726
  • 2
  • 15
  • 17
2

I respect your decision not to use Restlet, but for other browsers of this thread, I have been able to make Post work with Android/Restlet/GAE - and my knowledge and programming skills are fairly limited. I had some problems getting the Restlet Edition for Javascript to work correctly (it is still in early development), but Restlet for Android posed no problems that I can recall.

Richard Berger
  • 237
  • 2
  • 11
  • 1
    A bit unrelated... but from my experience so far. Restlet has turned out to be pain to work with, not so much with GAE and Android but as soon as GWT comes into the mix, it starts giving inexplicable problems – Saad Farooq Jul 17 '12 at 05:43
  • I'm not a huge fan of the Restlet API either, getting to set an http header for example is painful, but that's Restlet's philosophy, to abstract from Http! Anyway, the other pain point is the cold startup time. Do you think Cloud Endpoints would perform any better? they probably do the same jar scanning due to annotations – ZiglioUK Nov 12 '13 at 00:42
1

I would also like to recommend Restlet, see also other threads here

Restlet has an edition for GAE, see http://wiki.restlet.org/docs_2.0/13-restlet/275-restlet/252-restlet.html

But there are also other libraries which come with special editions for GAE, for example: http://code.google.com/p/xydra/wiki/RestLess

Community
  • 1
  • 1
ChrLipp
  • 15,033
  • 9
  • 70
  • 105
  • I've been using Restlet for the past three years, on App Engine. – ZiglioUK Nov 12 '13 at 00:40
  • Restlet has a fairly high startup time and my needs are pretty basic. I'm curious how Cloud Endpoints would compare to Restlet, any faster? other differences? – ZiglioUK Nov 12 '13 at 00:41
0

If you are looking at GAE, one choice you may consider is duyproject. It is know for it's openid library, but it also has a very light weight library for REST servlets. And with GAE you want to keep all the libraries light so you don't go over the byte limit.

Deanna
  • 696
  • 1
  • 5
  • 15