Spring下设置CXF的WebService客户端超时时长
来源:互联网 发布:RBF神经网络算法 编辑:程序博客网 时间:2024/06/06 00:24
- 背景:
- 在使用WebService的时候,我们可能需要一个备份的WebService服务器.一旦主服务器down了,我们可以使用备份的服务器.那么这里就需要对客服端连接服务器的时间做一个修改.
- 在Spring+CXF的WebService环境下,客户端有两个时间属性是可配置的,分别是ConnectionTimeout和ReceiveTimeout.
- ConnectionTimeout--WebService以TCP连接为基础,这个属性可以理解为tcp的握手时的时间设置,超过设置的时间长则认为是连接超时.以毫秒为单位,默认是30000毫秒,即30秒.
- ReceiveTimeout -- 这个属性是发送WebService的请求后等待响应的时间,超过设置的时长就认为是响应超时.以毫秒为单位,默认是60000毫秒,即60秒.
- beans.xml 设置的例子:
- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:jee="http://www.springframework.org/schema/jee"
- xmlns:jaxws="http://cxf.apache.org/jaxws"
- xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
- http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd
- http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
- http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd ">
- <http-conf:conduit name="{http://impl.service.product.super.com/}ProjectService.http-conduit">
- <http-conf:client ConnectionTimeout="10000" ReceiveTimeout="20000"/>
- </http-conf:conduit>
- </beans>
- 这里需要注意的有几个地方:
- 1:需要指定http-conf名称空间 xmlns:http-conf=http://cxf.apache.org/transports/http/configuration
- 2:指定模式位置: http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
- 3:http-conf:conduit中的name属性,指定设置生效的服务,如例子中,只对服务名为{http://impl.service.product.sww.com/}ProjectService的服务生效.
- 使用下面的设置则会对所有服务生效
- <http-conf:conduit name="*.http-conduit">
- </http-conf:conduit>
转自:http://www.cnblogs.com/wanggd/p/3217211.html
0 0
- Spring下设置CXF的WebService客户端超时时长
- Spring下设置CXF的WebService客户端超时时长
- Spring下设置CXF的WebService客户端超时时长 配置
- 设置CXF的WebService客户端超时时长
- 设置CXF的WebService客户端超时时长
- 设置CXF的WebService客户端超时时长
- CXF 客户端,设置超时时长
- 设置任务的超时时长
- EAS后台事务的超时时长如何设置?
- Linux设置sudo会话密码的超时时长
- ASP.NET设置session超时时长的4中方法
- spring + cxf 的webservice服务端和客户端功能
- Webservice的cxf开发_使用spring配置客户端
- cxf+spring发布webservice服务(客户端)
- CXF WebService 客户端设置超时时间
- Web Service (012---webservice使用CXF写基于Spring的WebService[服务端+客户端])
- cxf+Spring的webservice应用
- CXF集成SPRING的WEBSERVICE
- android intent MIME type
- java大数据处理-大量数据到Excel
- 一步一步学习JTHarness
- Python写黑客小工具,360免杀
- Android 使用NDK编写 基于C层的守护进程
- Spring下设置CXF的WebService客户端超时时长
- 一张对比图搞定markdown 基本用法
- GitHub--如何参与一个GitHub开源项目?
- solr group分组查询
- 使用TextView/EditText应该注意的地方
- 《如果你到了25岁 ,还没到30岁。》——李开复
- 156,UIWebView访问url,报权限问题
- iOS分享【OC】—— Masonry布局
- Codeforces Good Bye 2015 A. New Year and Days (水)