I'm converting a JAX-RPC client and service to JAX-WS, and am trying to figure out how to set the client timeout programmatically. This will be a JAX-WS 2.1 client running in WebSphere 7. In JAX-RPC, there was a property I could set on the SOAPBindingStub to set the timeout.
In the JAX-WS code, I've tried setting several properties as follows, with no luck:
PolicyFinderService policyFinderService = new PolicyFinderService();
PolicyFinder policyFinder = policyFinderService.getPolicyFinderSOAPPort();
((BindingProvider)policyFinder).getRequestContext().put(com.ibm.wsspi.websvcs.Constants.REQUEST_TIMEOUT_PROPERTY, 1);
((BindingProvider)policyFinder).getRequestContext().put(com.ibm.wsspi.websvcs.Constants.WRITE_TIMEOUT_PROPERTY, 1);
((BindingProvider)policyFinder).getRequestContext().put(com.ibm.wsspi.webservices.Constants.READ_TIMEOUT_PROPERTY, 1);
((BindingProvider)policyFinder).getRequestContext().put(com.ibm.wsspi.webservices.Constants.RESPONSE_TIMEOUT_PROPERTY, 1);
((BindingProvider)policyFinder).getRequestContext().put(com.ibm.wsspi.webservices.Constants.WRITE_TIMEOUT_PROPERTY, 1);
None of these have any effect when I make a call and the service isn't running, it just hangs for the default timeout value (I think 5 minutes) before timing out.
Has anyone found a way to programatically set this timeout value in WebSphere 7?