`

GWT Remote Service

    博客分类:
  • gwt
阅读更多

GWT Remote Service 远程调用服务

1.简介

远程调用使用webservice? 基于gwt + spring的服务,轻松解决远程调用

应用场景:app1的一个gwt服务 invoke app2的一个gwt服务

特性:

无需任何配置,只需gwt remote service包,以及效用的url,服务在spring中注册的id

 

2.demo

1)本服务基于spring + gwt 的服务,参考地址:http://jiangyongyuan.iteye.com/admin/show/143455

2) the client to invoke the remote gwt service

java 代码
  1. public class DemoClient {   
  2.     public static void main(String[] args) {   
  3.         /**  
  4.          * client端调用如下:  
  5.          * app: the application   
  6.          * rpc : the spring servlet  
  7.          * roleService : the gwt service id  
  8.          */  
  9.         RoleService myService = (RoleService) RemoteServiceLocator   
  10.                 .getRemoteService(RoleService.class,   
  11.                         "http://localhost:8888/app/rpc/roleService");   
  12.            
  13.         Users user = myService.queryLoginUser();   
  14.            
  15.         System.out.println("result = " + user.getUserID());   
  16.            
  17.         try {   
  18.             myService.queryAcl(user);   
  19.         } catch (ApplicationException e) {   
  20.             e.printStackTrace();   
  21.         }   
  22.     }   
  23. }  
 

 3.download url:

macaufly gwt toolkit:

http://code.google.com/p/macaufly-gwt-tool/downloads/list

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics