如何从外部应用程序调用GwtServiceImpl Servlet?

时间:2012-03-21 08:54:46

标签: gwt serialization service

我开发了一个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);

1 个答案:

答案 0 :(得分:0)

虽然,我没有尝试过,但以下链接似乎正是您所寻找的 http://googlewebtoolkit.blogspot.com/2010/07/gwtrpccommlayer-extending-gwt-rpc-to-do.html