3

I am using Google Appengine's Channel API to send events from server to the client.

The problem is Channel API only sends messages of type java.lang.String So my classes in the ~.shared package needs to be converted to string before I could pass them down to channel!

Since I'm using GWT for the client side I thought it would be good if I could use a 'free' serialisation provided by GWT.

How could I get GWT-RPC service to serialise my objects on the server side and send them to the channel?

I found this but it uses undocumented RPC which has already been changed. Any thoughts?

systempuntoout
  • 71,966
  • 47
  • 171
  • 241
langerra.com
  • 779
  • 3
  • 8

2 Answers2

4

Serializing for Channel API means that you will have to send a string representation, as long as the receiving client can marshall that string into a sensible object you're good to go.

Take a look at this question: Json <-> Java serialization that works with gwt.

JSON is probably what you want to send and receive when working with the channel API.

Community
  • 1
  • 1
Jon Nylander
  • 8,743
  • 5
  • 34
  • 45
2

I look at the Channel API as a way to send small messages to the client and the client can respond accordingly. This may be a small message just to "wake up" the client and have it go to the server and retrieve your objects using requestfactory or RPC.

Patrick Jackson
  • 18,766
  • 22
  • 81
  • 141