Spring 远程调用 HTTP invoker
来源:互联网 发布:优化安卓手机 编辑:程序博客网 时间:2024/06/11 16:43
Spring HTTP invoker是spring框架中的一个远程调用模型,执行基于HTTP的远程调用(意味着可以通过防火墙),并使用java的序列化机制在网络间传递对象。
所以所有的pojo类必须实现序列化接口
webservice
HTTP invoker
跨平台,跨语言
只支持java语言
支持SOAP,提供wsdl
不支持
结构庞大,依赖特定的webservice实现,如xfire等
结构简单,只依赖于spring框架本身
client:
<bean id="rciClientService"
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean"
abstract="false" lazy-init="default" autowire="default"
dependency-check="default">
<property name="serviceUrl">
<value>
${rci.service.url}/oprisk/kor/servlet/rciHttpService
</value>
</property>
<property name="serviceInterface">
<value>
com.citi.oprisk.kor.service.IRCIClientService
</value>
</property>
</bean>
build.xml:
<path id="compileClasspath">
<pathelement path="${ejbclient.dir}/RCI_client.jar" />
</path>
*-remote-call.properties:
rci.service.url=http://localhost:9080
sever:
<bean id="rciHttpService"
class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter" >
<property name="service">
<ref bean="rciClientService" />
</property>
<property name="serviceInterface"
value="com.citi.oprisk.kor.service.IRCIClientService">
</property>
</bean>
<bean id="rciClientService"
class="com.citi.oprisk.kor.service.RCIClientService">
<property name="korMaintainService">
<ref bean="korMaintainService" />
</property>
</bean>
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="alwaysUseFullPath" value="true" />
<property name="mappings">
<props>
<prop key="/servlet/rciHttpService">rciHttpService</prop>
</props>
</property>
</bean>
build.xml:
<target name="rciClientJar" depends="init,compile">
<jar jarfile="${distDir}/RCI_client.jar"
basedir="${javaClassDir}">
<include name="com/citi/oprisk/kor/service/IRCIClientService.class"/>
......
</jar>
</target>
步骤:
1. 创建一个HTTP invoker服务输出者类(HttpInvokerServiceExporter)
2. 创建一个HTTP代理(使用HttpInvokerProxyFactoryBean)。你要细化这个类里的参数像serviceUrl和serviceInterface。
3. 为客户端调用远程HTTP服务定义一个URL映射。
4. 配置Spring beans。
5. 在web。xml文件里配置Spring Web层(DispatcherServlet)。
6. 写客户类(使用HTTP或者Commons HttpClient)。
- Spring 远程调用 HTTP invoker
- 使用Spring HTTP invoker进行远程调用
- Spring HTTP Invoker-远程调用模式
- 【JAVA】Spring HTTP Invoker 远程服务调用
- Spring HTTP invoker简介
- Spring HTTP invoker简介
- Spring HTTP invoker简介
- Spring HTTP invoker简介
- Spring HTTP invoker简介
- spring http invoker 实践
- Spring Http Invoker
- Spring学习 HTTP Invoker
- Spring HTTP invoker RPC
- Spring HTTP Invoker使用
- Spring HTTP Invoker
- Spring HTTP invoker简介
- Spring HTTP Invoker
- Spring Http Invoker
- jQuery插件 SlabText的实现原理
- 使用 UI Automation 实现自动化测试--4.2
- jsp中遍历long型日期格式
- java 按照部门统计TIPTOP单据数量
- IE跟FF输入值监听-------自写
- Spring 远程调用 HTTP invoker
- Ansi、Unicode、UTF8字符串之间的转换和写入文本文件
- 使用 UI Automation 实现自动化测试--4.3
- 使用 UI Automation 实现自动化测试--4.4
- ActionBar-Three Dot
- Flash网站怎样做SEO优化,Flash怎样优化?
- 使用 UI Automation 实现自动化测试--4.5
- 关于视图控制器的初始化 viewController
- 使用UI Automation实现自动化测试--4.6.1