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.
精彩评论