I have a JAX-WS webservice client. I tried to set the timeout property like this:
Map<String, Object> requestContext = bp.getRequestContext();
requestContext.put(BindingProviderProperties.REQUEST_TIMEOUT, 20);
//I also tried using
//"javax.xml.ws.client.receiveTimeout" in the place of REQUEST_TIMEOUT
//It behaved the same way.
requestContext.put(BindingProviderProperties.CONNECT_TIMEOUT, 10000);
For more details see the question How do I set the timeout for a JAX-WS webservice client?
However, I'm not seeing the timeout occur. It should give a read timeout as the service we triggered is not providing a response in 20 milliseconds. We also tried to making the REQUEST_TIMEOUT value negative but it is giving the same response. From this I confirmed that the value set in request context is not specifying timeout to the service.
Does anyone know why this setting isn't working and what I should be doing instead?