- 浏览: 202833 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
maxrocray:
现在没管用的了。。。
google的IP地址列表 -
greenwen:
谢谢您的分析,学习受教了
几种通讯协议的比较 -
chaiying:
...
几种通讯协议的比较 -
liyan12167:
哥们 我想向您请教些更详细的内容 不知道你还会在上线不 上来 ...
什么是SyncML -
追求幸福:
...
SyncML相关资源链接
<!-- Hessian服务的接口-->
<property name="serviceInterface" value="com.demo.api.server.DemoService" />
</bean>
在该配置下,Hessian服务的url是
http://IP:port/**/remote/HessianService,其中**是该应用的url。Spring使用DispatcherServlet拦截到匹配/remoting/*的请求,然后将该请求转发到对应的bean,该bean在dispatcher-servlet.xml文件中以HessianServiceExporter定义。
二.客户端
同样我们创建工程和代码
Web project&code
public interface DemoService {
List getUsers();
}
下面注意了:
创建可序列化对象,就是Server端的那个syncobject,而且要implements Serializable。这个也是我们要远程对象调用的domain类。
public class SyncObject implements Serializable {
/**
* Comment for <code>serialVersionUID</code>
*/
private static final long serialVersionUID = 1L;
private String username="";
private String password="";
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
配置文件config.xml
<bean id="hessianService" class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
<!--服务器端发布的地址URL-->
<property name="serviceUrl" value="http://ip:port/**/remote/HessianService" />
<!--本地接口à
<property name="serviceInterface" value="com.demo.api.client.DemoService"/>
</bean>
最后我们写个测试方法:
public static void main(String[] args) {
final ApplicationContext context = new ClassPathXmlApplicationContext("config.xml");
DemoService service = (DemoService)context.getBean("hessianService");
try {
List<SyncObject> userlist= service.getUsers();
for (SyncObject user : userlist) {
System.out.println(user.getUsername());
}
}
catch(RemoteException e) {
e.printStackTrace();
}
}
Run一把试试,(确保服务器端runing状态哦)
下面是成功后的信息,结果是从服务器端取到了2个用户的username。
2008-12-31 10:31:15 org.springframework.core.CollectionFactory <clinit>
信息: JDK 1.4+ collections available
2008-12-31 10:31:16 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [config.xml]
2008-12-31 10:31:16 org.springframework.context.support.AbstractRefreshableApplicationContext refreshBeanFactory
信息: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=11988197]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [hessianService]; root of BeanFactory hierarchy
2008-12-31 10:31:16 org.springframework.context.support.AbstractApplicationContext refresh
信息: 1 beans defined in application context [org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=11988197]
2008-12-31 10:31:16 org.springframework.context.support.AbstractApplicationContext initMessageSource
信息: Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@b8f82d]
2008-12-31 10:31:16 org.springframework.context.support.AbstractApplicationContext initApplicationEventMulticaster
信息: Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@b1b4c3]
2008-12-31 10:31:16 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
信息: Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [hessianService]; root of BeanFactory hierarchy]
2008-12-31 10:31:16 org.springframework.aop.framework.DefaultAopProxyFactory <clinit>
信息: CGLIB2 not available: proxyTargetClass feature disabled
username1 from server
username2 from server
发表评论
-
session 处理2种方式
2010-01-21 17:25 1394随着互联网的日益壮大,网站的pv和uv成线性或者指数倍的增加. ... -
异质数据结构
2009-11-21 12:28 1424堆栈、队列、链表等数据结构中的数据通常都是单一类型 ... -
Java获取代理客户端真实IP地址
2009-09-11 18:06 1911在JSP里,获取客户端的IP地址的方法是:request.ge ... -
杂论架构
2009-09-07 09:16 1045一、架构的含义 许多人对什么是架构或者架构设计包含什么内容比 ... -
nginx后面的jboss获取不到真实IP解决方案
2009-07-24 11:01 4161nginx+(1…n)tomcat集群部署时,后端tomcat ... -
byte short int long float double
2009-07-22 17:58 1503byte: 八位整数 -128——127,可用来节省内存的使用 ... -
架构思想
2009-06-26 10:15 1022一 架构思想 1.1 HTML页 ... -
jboss 4.22 优化心得
2009-01-16 13:39 1168增大可使用内存,修改bin/run.sh文件 JAVA_OPT ... -
JBoss 5.0 安装配置负载均衡
2009-01-14 17:39 5939简明JBOSS 5的安装配置说明 环境为Linux AS ... -
基于Hessian的高性能远程对象调用的服务器端和客户端的Demo
2008-12-31 10:48 2737概要介绍 在我们的项目中,特别是在J2EE分布式系统中,我们经 ... -
剔除List中的重复值
2008-08-28 22:34 1926方法一:循环元素删除 // 删除ArrayList中重复 ... -
spring 2.5 mvc annotation使用
2008-06-11 11:16 2709项目中一种在用spring2.0,虽然2.5出来了很多新特性, ... -
webwork2中文参考手册.pdf
2008-05-11 22:54 1834webwork2中文参考手册.pdf -
Spring-MVC-step-by-step2.rar
2008-05-11 22:51 887Spring-MVC-step-by-step2.pdf -
学习Spring
2008-05-08 11:58 12491、如何学习Spring? ... -
基于Spring技术应用的远程服务
2008-05-08 11:04 931来源:赛迪网 一.引言 从根本上分析,Remoting实 ... -
几种通讯协议的比较
2008-05-08 10:54 8182一、综述 本文比较了RMI,Hessian,Burlap,Ht ... -
webwork之HelloWorld篇
2008-04-29 15:20 1330任何结果都是由简单的实践得出的,当然我下面的介绍也是模仿那些大 ... -
JDK1.5中的线程池使用简介
2008-04-25 17:49 2793学习 JDK1.5中的线程池使用简介 ... -
jboss 启动时java.sql.SQLException: User not found: SA
2008-04-03 17:11 2485修改下面的文件: jboss-4.0.3\server\def ...
相关推荐
hessian 服务器 客户端 demo
hessian demo 包括服务端和客户端,绝对能用,包括了jar包
基于加密技术的Hessian 远程调用的研究与实现
c#实现的hessian的服务端和客户端,iis亲测可以通过,
Hessian Binary Web Service Protocol远程接口调用入门Demo例子!
java项目中使用hessian框架实现远程调用,该资源内附hessian服务端,hessian客户端和使用说明文档,以供使用参考,轻松教会你hessian远程调用!
hessian简单demo,server发布服务+client调用服务,包含源码和hessian的jar包
在开发过程中,有时需公用某个工程的接口,需要用到hessian实现远程调用
Hessian远程调用框架学习一,第一个JAVA使用hessian的入门demo,简单实用易理解
1. 什么是 rpc RPC 全称为 Remote Procedure Call,翻译过来为 “远程过程调用”。 目前,主流的平台中都支持各种远程调用技术,以满足...RPC 在使用形式上像调用本地函数(或方法)一样去调用远程的函数(或方法)。
Hessian是一个由Caucho Technology开发的轻量级二进制RPC协议。本人做了一个简单的应用,大家可以往更深的方向研究,共同进步,msn:yang-yang-90@hotmail.com
一个简单实用的hessian框架的应用实例,用于实现分布式开发远程调用!
使用hessian进行服务器和客户端通讯,此案例包括服务器和java客户端,参考博客:http://blog.csdn.net/tan313/article/details/49536163
想学习Hessian的同志们,这个是一个简单的demo。比较简单,不过能够加深对Hessian的理解
基于java实现hessian进行服务器之间数据交互demo项目 实现功能: 1.基于spring 2.5.6+hessian3.1.6带有签名安全机制 2.基于servlet代理机制实现HessianServlet,进行简单IP地址校验功能!
spring springmvc hessian rpc客户端及服务端示例demo,可直接运行,适合hessian入门的同学们学习,仅供有需要的同学们参考
hessian 服务端 客户端 可运行
hessian-demo工程示例,已集成内置jetty插件,可以直接运行。 spring4,hessian4.0.7
使用eclipse maven工程搭建hessian远程服务demo 分服务端的整合和客户端 建议阅读相关博客http://blog.csdn.net/heisemuyangquan/article/details/79460528
基于Hessian的冠状动脉血管造影分割方法