您的位置:首页 > 编程语言 > Java开发

javax.xml.ws.WebServiceException: java.net.SocketTimeoutException: Read timed out

2011-06-07 18:23 1216 查看
Once you encounter the error as title , you are considering how to set the time out for the webservice client .The senario is JAX-WS type in webservice .

The java.net.HTTPURLConnection is used to implement the ws client in jax-ws . To set up the config , you need to get the binding provider reference . Please refer to the below codes .

xxxxxWebService ws = new xxxxxWebService(url,new QName("http://xxx.xxx.xxx.xxx.xxx/", "xxxxxWebService"));
IShipWebService ishipws = ws.getIShipWebServicePort();
BindingProvider bp = (BindingProvider)ishipws;
Map requestContext = bp.getRequestContext();
requestContext.put(JAXWSProperties.CONNECT_TIMEOUT,1000*60);
requestContext.put(BindingProviderProperties.REQUEST_TIMEOUT,1000*60);

The important thing to resolve this issue is to find out the binding provider in your programme.

JAXWSProperties.CONNECT_TIMEOUT is config for the connection time (time cost in the connection to the server).

BindingProviderProperties.REQUEST_TIMEOUT is config for the value of read timed out .
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: