GWT Remote Service

本文介绍了一种基于GWT+Spring的GWTRemoteService远程调用方案,无需额外配置即可实现服务间的轻松调用。通过具体示例展示了如何在客户端应用中调用远程GWT服务。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值