如何使用 HttpClient 发送 GWT-RPC 请求?

AYA*_*rem 5 java gwt httprequest apache-commons-httpclient

我正在使用 Apache HTTPClient API 发送 HTTPRequest,到目前为止它可以处理标准请求。现在我想发送 GWT-RPC 请求并显示响应,但我总是从 GWT-RPC 服务器收到以下错误:

 //EX[2,1,"com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException/3936916533","This application is out of date, please click the refresh button on your browser. ( Malformed or old RPC message received - expecting version 5 )"],0,5]
Run Code Online (Sandbox Code Playgroud)

实际上,我必须随请求发送以下数据:

5|0|5|http://172.16.103.244:38081/kunagi/scrum.ScrumGwtApplication/|6E611C647A0C98D5A31A2506E16D81D6|scrum.client.ScrumService|startConversation|I|1|2|3|4|1|5|-1|
Run Code Online (Sandbox Code Playgroud)

但我不知道怎么做。

当我从 FireBug 检索请求代码时,我在帖子区域中找到了上述数据作为来源。

Adr*_* B. 2

查看gwt-syncproxy项目。它完全符合您的要求,从 Java 代码中伪造 RCP 调用。如果您不想将项目依赖于gwt-syncproxy,您可以查看它的实现并了解如何创建有效的请求。