Axis2如何设置连接超时时间

Axis2如何设置连接超时时间,第1张

应该可以的,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)

可能是wsdl2java命令没有生成超时的代码,具体需要研究下生成代码的wsdl2java的工作原理,我一般都是手动设置超时时间

Service service = new Service()

Call call = (Call) service.createCall()

call.setTimeout(1000*60*15) //设置超时时间 15分钟


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/tougao/11455112.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-16
下一篇 2023-05-16

发表评论

登录后才能评论

评论列表(0条)

保存