How can I call a GWT RPC method on a server from a non GWT (but Java) gapplication?

后端 未结 5 1101
感动是毒
感动是毒 2020-12-24 08:56

I have a regular Java application and want to access an GWT RPC endpoint. Any idea how to make this happen? My GWT application is on a GAE/J and I could use REST for example

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-24 09:47

    The Java implementation in GWT of the RPC protocol in the packages com.google.gwt.user.server.rpc and com.google.gwt.user.server.rpc.impl unfortunately only covers deserialization of requests and serialization of responses. The real work is done in the classes ServerSerializationStreamReader and ServerSerializationStreamWriter (each appr. 750 lines of code).

    To implement a client, you obviously need to serialze the request and deserialize the response, but since there's no documentation available for the protocol and AFAIK no Java client implementations available, you probably would have to reverse-engineer the (de)serialization classes and write your own code to do everything "the other way around".

    You can find some high-level info about the protocol here

提交回复
热议问题