参考这篇文章https://www.cnblogs.com/fanqisoft/p/10283156.html

将提供者配置类中的

1     @Bean
2 public HessianServiceExporter hessianExporterUserService(UserService userService){
3 HessianServiceExporter hessianServiceExporter = new HessianServiceExporter();
4 hessianServiceExporter.setService(userService);
5 hessianServiceExporter.setServiceInterface(UserService.class);
6 return hessianServiceExporter;
7 }

替换为

     @Bean
public HttpInvokerServiceExporter httpExporterUserService(UserService userService){
HttpInvokerServiceExporter exporter = new HttpInvokerServiceExporter();
exporter.setService(userService);
exporter.setServiceInterface(UserService.class);
return exporter;
}

将服务消费者

1     @Bean
2 public HessianProxyFactoryBean userService(){
3 HessianProxyFactoryBean proxy = new HessianProxyFactoryBean();
4 proxy.setServiceUrl("http://localhost:8081/SpringRmiService_war_exploded/user.service");
5 proxy.setServiceInterface(UserService.class);
6 return proxy;
7 }

替换为

     @Bean
public HttpInvokerProxyFactoryBean userService(){
HttpInvokerProxyFactoryBean proxy = new HttpInvokerProxyFactoryBean();
proxy.setServiceUrl("http://localhost:8081/SpringRmiService_war_exploded/user.service");
proxy.setServiceInterface(UserService.class);
return proxy;
}

SpringMVC使用HttpInvoker发布远程服务的更多相关文章

  1. SpringMVC使用Hession发布远程服务

    (1)三个项目,Api(存放提供者和消费者共有的xx,例如实体类以及服务接口等等).Service(服务提供者).Provider(服务消费者) Api部分代码 package cn.coreqi.e ...

  2. SpringMVC使用Burlap发布远程服务

    参考这篇文章https://www.cnblogs.com/fanqisoft/p/10283156.html 将提供者配置类中的 @Bean public HessianServiceExporte ...

  3. SpringMVC整合Hessian访问远程服务

    1.1     Hessian简介       Hessian是一个轻量级的Web服务实现工具,它采用的是二进制协议,因此很适合发送二进制数据.它的一个基本原理就是把远程服务对象以二进制的方式进行发送 ...

  4. spring远程服务知识梳理

    序:本文主要是总结和归纳spring的远程服务相关知识,可作为入门学习笔记.写博客目的也是为了进行知识梳理,便于以后查看.本文主要参考资料 spring 实战第三版 本文主要讨论内容如下: 远程调度概 ...

  5. Java实现远程服务生产与消费(RPC)的4种方法-RMI,WebService,HttpClient,RestTemplate

    目录 一. 通过rmi实现远程服务的生产与消费 远程服务提供者实现. 创建rmi-provider项目(Maven) 远程服务消费者实现 创建rmi-consumer项目 二. 通过WebServic ...

  6. java RPC系列之二 HTTPINVOKER

    java RPC系列之二  HTTPINVOKER 一.java RPC简单的汇总 java的RPC得到技术,基本包含以下几个,分别是:RMI(远程方法调用) .Caucho的Hessian 和 Bu ...

  7. Dubbo2.7源码分析-如何发布服务

    Dubbo的服务发布逻辑是比较复杂的,我还是以Dubbo自带的示例讲解,这样更方便和容易理解. Provider配置如下: <?xml version="1.0" encod ...

  8. Maven 使用Eclipse构建Maven的SpringMVC项目

    首先Eclipse需要安装Maven的插件,地址:http://m2eclipse.sonatype.org/sites/m2e. 用MyEclipse安装Maven插件,建出的Maven项目有些问题 ...

  9. Dubbo——服务发布原理

    引言 在使用Dubbo的时候你一定会好奇它是怎么实现RPC的,而要了解它的调用过程,必然需要先了解其服务发布/订阅的过程,本篇将详细讨论Dubbo的发布过程. 源码分析 发布服务 新学Dubbo大都会 ...

随机推荐

  1. [CF791D]Bear and Tree Jumps

    题目描述 A tree is an undirected connected graph without cycles. The distance between two vertices is th ...

  2. 洛谷 P1627 [CQOI2009]中位数 解题报告

    P1627 [CQOI2009]中位数 题目描述 给出1~n的一个排列,统计该排列有多少个长度为奇数的连续子序列的中位数是b.中位数是指把所有元素从小到大排列后,位于中间的数. 输入输出格式 输入格式 ...

  3. Codeforces-gym-101020 problem C. Rectangles

    题目链接:http://codeforces.com/gym/101020/problem/C C. Rectangles time limit per test 2.0 s memory limit ...

  4. A1080. Graduate Admission

    It is said that in 2013, there were about 100 graduate schools ready to proceed over 40,000 applicat ...

  5. 【洛谷P4735】最大异或和

    题目大意:给定一个长度为 N 的序列,支持两个操作:在序列末尾添加一个新的数字,查询序列区间 \([l,r]\) 内使得 \(a_p\oplus a_{q+1}\oplus ... a_N\oplus ...

  6. NO.10: 在operator=中处理 "自我赋值"

    1.确保当对象自我赋值时operator=有良好的行为,其中的技术包括 "来源对象" 和 "目标对象" 的地址,精心周到的语句顺序,以及“ copy and s ...

  7. EClipse for PHP 中文乱码问题

    UTF-8 格式的php,中文都是乱码. 如果此时在EClipse中输入中文会有 CP1252 错误( CP1252不支持xxxx ) 解决方法: windows->preferences-&g ...

  8. 配置GitLab Push 自动触发Jenkins构建

    配置GitLab Push 自动触发Jenkins构建 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 本篇博客是对之前的笔记:https://www.cnblogs.com/yin ...

  9. nGrinder TestRunnerInsertMysqlMore.groovy

    s C:\Users\Lindows\workspace\GroovyTest\src\com\iteye\lindows\mysql\TestRunnerInsertMysqlMore.groovy ...

  10. javascript 函数的4种调用模式

    1. 函数模式 // this 指向 window 全局对象 2. 方法模式 // this 指向调用这个方法的对象 3. 构造函数模式 // this 指向 new 新创建出来的实例 4. 上下文模 ...