views:

54

answers:

1

I'm looking for the algorithm that Google's Web Toolkit uses to serialize data posted to the server during an AJAX request. I'm looking to duplicate it in another language so that I can tie in another of my projects with a GWT project.

Any help is much appreciated!

+2  A: 

The GWT-RPC serialization is heavily tied to Java. It even sends Java class names over the wire.

I suggest you use something like JSON to communicate with the server. This way, you can use any programming language with the GWT server.


Update: There are no definitive references to the GWT-RPC format, and a mailing list post explains that decision:

The GWT RPC format is intentionally opaque JSON. This makes it somewhere between difficult and impossible to add a non-GWT agent to the RPC discussion. There isn't really a nice work-around for creating a non-Java server-side implementation but, because your RemoteServiceServlet implementation just has to implement your synchronous RPC interface, it's quite possible for non-GWT clients to talk to the same server-side business logic, just without using the RPC protocol.

and the little detail which surfaced was

The wire format is plain text. It's actually JSON. It's just unreadable JSON because the assumption is that both the producing and consuming code is auto-generated and can make all kinds of assumptions about the structure of the text.

Robert Munteanu
This will probably be the route I'll go down. However, I would be interested in learning about how the serialization takes place purely for reference. Do you know of any articles/resources/specific code I should look into?
JoeR
@JoeR : please see my update.
Robert Munteanu