应该可以的,setTimeOutInMilliSeconds是设毫秒的喔,你尝试陪如孙一芦链下再改短一点橡皮。setTimeOutInMilliSeconds(100L)。
org.apache.commons.httpclient.ConnectTimeoutException: The host did not accept the connection within timeout of 100 ms
at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:155)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:125)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
MultiThreadedHttpConnectionManager conmgr = new MultiThreadedHttpConnectionManager();
conmgr.getParams().setSoTimeout( 10000 ); /裤孙咐胡纯凯缺/10秒
HttpClient httpclient = new HttpClient(conmgr);
....
options.setProperty( HTTPConstants.CACHED_HTTP_CLIENT, httpclient );
......
serviceClient.setOptions(options);