【发布时间】:2018-05-14 08:27:41
【问题描述】:
我们有一个肥皂请求,我们设置了300ms 的超时时间,当我们提出一个请求时,它占用的时间超过了300ms,比如1500ms 或更多,但我们没有得到我们设置的超时异常作为响应.
我们这样打电话
SOAPMessage soapResponse = soapConnection.call(createSOAPRequest(requestWrapper, parammap), endpoint);
和init 方法中的endpoint 形式像这样
endpoint = new URL(new URL(URL_CONSTANT), super.getEndpoint(), new URLStreamHandler() {
@Override
protected URLConnection openConnection(URL url) throws IOException {
URL target = new URL(url.toString());
URLConnection connection = target.openConnection();
// Connection settings
connection.setConnectTimeout(getTimeout());
connection.setReadTimeout(getTimeout());
return (connection);
}
});
在上面的代码中,getTimeout() 函数正常工作,它设置了300,但我们不确定为什么它不工作,
请提出一些建议。
【问题讨论】:
标签: java spring soap spring-ws