我开发了一个Gwt应用程序,现在需要调用它的远程服务实现 来自另一个java应用程序是否有一个方法给定一个Java对象列表可以以适合调用get服务servlet的格式转换它们?类似于:
myObject = .......
try {
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost postRequest = new HttpPost(
"http://localhost:8080/ppp//org.yournamehere.Main/gwtservice");
String serialized = <somelibrary.serialize>(myObject);
StringEntity input = new StringEntity(serialize);
input.setContentType("text/x-gwt-rpc; charset=UTF-8");
postRequest.setEntity(input);
HttpResponse response = httpClient.execute(postRequest);
答案 0 :(得分:0)
虽然,我没有尝试过,但以下链接似乎正是您所寻找的 http://googlewebtoolkit.blogspot.com/2010/07/gwtrpccommlayer-extending-gwt-rpc-to-do.html