GWT serialization and Api add channel

I use the Google Appengine APIs to send events from server to client.

The problem is that the channel API sends messages like java.lang.String. Therefore, my classes in the ~ .shared package must be converted to a string before I could pass them to the channel!

Since I use GWT for the client side, I thought it would be nice if I could use the “free” serialization provided by GWT.

How can I get a GWT-RPC service to serialize my objects on the server side and send them to the channel?

I found this one , but uses an undocumented RPC that has already been modified. Any thoughts?

+3
source share
2 answers

Serialization for the Channel API means that you will need to send a string representation if the receiving client can output this string to a reasonable object that suits you.

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

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

+4
source

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 only to “wake up” the client and transfer it to the server and retrieve your objects using requestfactory or RPC.

+2
source

Source: https://habr.com/ru/post/1782248/


All Articles