Perfect answer, exactly what I was looking for!

Although internal representation of the data being sent through RPC
call doesn't matter to me - I was a little surprised due to lack of
JSON in serialized string.

Thanks for your time and good day

Regards
Natalie

On May 19, 2:46 pm, monkeyboy <[email protected]> wrote:
> If you have a service interface Service:
> @RemoteServiceRelativePath("service")
> public interface Service extends RemoteService {
>     void send(Message m);
>
> }
>
> You can do the following
> Message m = new Message();
> // initialize message
> SerializationStreamFactory sf = GWT.create(Service.class);
> SerializationStreamWriter writer = sf.createStreamWriter();
> writer.writeObject(m);
> int size = writer.toString().length();
>
> writer.toString() returns the actual serialized Message object.
>
> AFAIK GWT serialization is asymetric so perhaps the size is a bit different
> when the Message object is sent from the server to the client.
> Hope this helps.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to