views:

685

answers:

4

I want to use XStream to serialize my RPC calls on my GWT application, and I'm hoping to get it done both ways, as I'm sending java objects back and forth. Is it possible to run XStream on the client side? how? Alternatively, can you recommend of any other xml-serializer for the client side?

A: 

I don't think it's possible to run XStream on the browser. Why don't you serialize using native JSON on the client side? XStream has got JSON parsing capabilities on the server. See http://xstream.codehaus.org/json-tutorial.html

cherouvim
This would also be much more efficient on the client side because you can just eval the JSON objects, much better then parsing XML in Javascript.
Arthur Kalmenson
A: 

I'm confused. You have a Java back end? Why not use the built in RPC mechanism? It's second to none if you're running Java on the back end.

rustyshelf
A: 

I developed a client-side XML serializer, modeled after XStream. It uses annotations and GWT code generators to create serializers at compile time. It's a custom in-house project. I've wanted to polish it up and open source it but I just don't have the time right now. I just wanted to say it's possible... maybe someone will put something out there.

You're probably better off doing JSON or GWT-RPC however (even if it means you have an seperate endpoint that has to reroute calls). It's all about ease of maintenance (not hand-writing serializers).

Mark Renouf
A: 

Any update on the GWT Xstream serializer?

In our current project, it would be so usefull to have it... could you share it?

Thanks, Vincenzo.

Vincenzo Vitale