开发者

How to set timeout in apache cxf dynamic client

开发者 https://www.devze.com 2023-04-11 01:15 出处:网络
I\'m using the Apache CXF DynamicClientFactory to dynamically request web services. How can I set a timeout there? I can only find examples with 开发者_JAVA百科static generated java stubs, but no exam

I'm using the Apache CXF DynamicClientFactory to dynamically request web services. How can I set a timeout there? I can only find examples with 开发者_JAVA百科static generated java stubs, but no example for the dynamic approach... thank you!


Pseudo code:

javax.xml.ws.BindingProvider bp = (BindingProvider) yourStub.get...Port();    
Client client = ClientProxy.getClient(bp);
HTTPConduit http = (HTTPConduit) client.getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout(36000);
http.setClient(httpClientPolicy);

Found this here and something similar here.


Please try taking a look here.

If you scroll down a bit, you will see how to set the timeout using an integer.

0

精彩评论

暂无评论...
验证码 换一张
取 消