2016-01-19 57 views
1

我正在使用apache CXF執行JAX-WS。 我的Web服務通過使用JaxWsProxyFactoryBeanspring xml配置配置:如何使用XML配置和JaxWsProxyFactoryBean增加Apache CXF超時?

<bean id="myWSClient" class="my.package.MyWSClient" 
     factory-bean="clientFactory" 
     factory-method="create" /> 

<bean id="clientFactory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean"> 
    <property name="serviceClass" value="my.package.MyWSClient"/> 
    <property name="address" value="http://some.url"/> 
</bean> 

,後來我通過注射它:

@Resource(name = "myWSClient") 
MyWSClient myWSClient; 

我怎麼能管理,以增加timeout爲MyWSClient?

回答

1

配置客戶端超時使用spring configuration使用這樣的:

<http-conf:conduit name="*.http-conduit"> 
    <http-conf:client 
      ConnectionTimeout="600000" 
      ReceiveTimeout="600000"/> 
</http-conf:conduit> 

在這個例子中超時響應和連接設置爲600秒。