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 .
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 .
相关文章推荐
- java.net.SocketTimeoutException: Read timed out
- One Cause of java.net.SocketTimeoutException: Read timed out
- java.net.SocketTimeoutException: Read timed out
- org.apache.solr.client.solrj.SolrServerException: java.net.SocketTimeoutException: Read timed out
- java.net.SocketTimeoutException: Read timed out
- java.net.SocketTimeoutException: Read timed out 错误解决
- 【生产问题直播】java.net.SocketTimeoutException: Read timed out
- java.net.SocketTimeoutException: Read timed out 的解决办法
- java.net.SocketTimeoutException: Read timed out
- java.net.sockettimeoutexception read timed out 异常
- java后台接收文件java.net.SocketTimeoutException: Read timed out
- tomcat servlet java.net.SocketTimeoutException: Read timed out 解决办法
- jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out
- java.net.SocketTimeoutException: Read timed out 的解决办法 android平台 腾讯微博开发
- java.net.sockettimeoutexception read timed out
- 调用webservice的时候报错 java.net.SocketTimeoutException: Read timed out
- JMeter测试问题java.net.SocketTimeoutException: connect timed out,Read timed out
- java.net.SocketTimeoutException: Read timed out
- java.net.SocketTimeoutException: Read timed out
- java.net.SocketTimeoutException: Read timed out