开发者

How to set timeout in apache cxf dynamic client

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜