Hello Christophe,
It is theoretically possible but it would require some work. Independent of the implementation, you will need the following pieces to make this work:
- You will need a class that can instantiate every type that the client can receive via JSON.
- You will need a class that can set the fields of the new instance based on the contents of the JSONObject. (One class to handle all or one class per instance is up to you. You will need to use JSNI to set the fields.)
You have two choices in terms of implementation:
- Bootstrap your implementations by using the code that the RPC system generates for you and tweaking it to fit your needs.
- Write it yourself using your own concepts.
I know that #2 sounds bad but it may be easier to do depending on your level of GWT proficiency. From your email, it sounds like you are leaning towards #1. If you do that you will need to modify the generated proxy code to use whatever type name format you want to use. You will also need to write an adaptor that exposes an implementation of the SerializationStreamReader interface but whose implementation actually reads the values out of your JSONObject. Otherwise, you would need to convert an JSONObject into our serialized format so that you could use a stock ClientSerializationStreamReader.
HTH,