CXF客户端设置连接超时时间
2017-08-12 09:41
537 查看
1、使用Java代码设置:
(1)、需要指定
(2)、指定模式位置:
Service wsService = new Service(); ServicePortType portType = wsService.getService(); Client proxys = (ClientImpl) ClientProxy.getClient(portType); HTTPConduit conduit = (HTTPConduit) proxys.getConduit(); HTTPClientPolicy policy = new HTTPClientPolicy(); policy.setConnectionTimeout(20*1000); policy.setAllowChunking(false); policy.setReceiveTimeout(10*1000); conduit.setClient(policy);2、在Spring配置文件中配置
<?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="{WSDL Namespace}portName.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[/code]
(3)、http-conf:conduit中的name属性,指定设置生效的服务。name属性由service的namespace、WSDL中的 port name和".http-conduit"组成,如{http://apache.org/hello_world}HelloWorld.http- conduit。如果将name属性设置为“*.http-conduit”,则会对所有服务生效。
相关文章推荐
- CXF 客户端超时时间设置(非Spring配置方式)
- CXF WebService 客户端设置超时时间
- MINA源码分析---对客户端设置连接间隔时间的过滤器
- HttpClient 4.5版本设置连接超时时间
- CXF 客户端,设置超时时长
- HttpClient 4.5版本设置连接超时时间
- Spring下设置CXF的WebService客户端超时时长 配置
- Axis1客户端连接超时的设置方法!!!
- CXF 连接超时与请求超时的设置
- Socket 关于设置Socket连接超时时间
- 服务器上传,时间超时 tomcat 如何设置保持连接
- SSH 远程连接 超时时间设置
- HttpClient 4.5版本设置连接超时时间
- Java基础网络---2-----连接到服务器(设置链接超时时间)
- Spring下设置CXF的WebService客户端超时时长
- ssh连接超时时间(ssh timeout)的设置方法
- 设置CXF的WebService客户端超时时长
- CXF-WebService设置超时时间
- Axis2 客户端调用 设置超时时间
- 客户端C和服务器S之间建立一个TCP连接,该连接总是以1KB的最大段长发送TCP段,客户端C有足够的数据要发送。当拥塞窗口为16KB的时候发生超时,如果接下来的4个RTT往返时间内的TCP段的传输是成