设置 Axis SOAP Web 服务超时
我正在使用像这样的 Axis 1.4 Web 服务:
FooServiceLocator fooLocator = new FooServiceLocator();
fooLocator.getEngine().setOption("sendMultiRefs", false);
Foo foo = fooLocator.getFooService(new URL(soapServiceUrl));
How can I set a timeout for the connection建立和打开的连接? (类似于 org.apache.commons.net.SocketClient setTimeout()
和 setSoTimeout()
)?
我发现了一个提示,建议设置这样的超时:
((Stub) sPcspService).setTimeout(soapTimeoutSecs * 1000);
但显式转换看起来更像是一种黑客行为,而不是官方 API 使用。
Grepping 源代码我找到了参考
DefaultCommonsHTTPClientProperties.CONNECTION_DEFAULT_SO_TIMEOUT_KEY
但我既不知道我是否使用 Commons HTTP Client
还是其他客户端,也不知道如何应用此选项。
I'm using an Axis 1.4 webservice like this:
FooServiceLocator fooLocator = new FooServiceLocator();
fooLocator.getEngine().setOption("sendMultiRefs", false);
Foo foo = fooLocator.getFooService(new URL(soapServiceUrl));
How can I set a timeout for the connection establishment and for the opened connection?
(Similar to org.apache.commons.net.SocketClient
setTimeout()
and setSoTimeout()
)?
I found a hint that suggested setting a timeout like this:
((Stub) sPcspService).setTimeout(soapTimeoutSecs * 1000);
but the explicit cast looks more like a hack than on official API usage.
Grepping the source code I found references to
DefaultCommonsHTTPClientProperties.CONNECTION_DEFAULT_SO_TIMEOUT_KEY
but neither do I know if I use the Commons HTTP Client
or another, nor how to apply this option.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我曾经也使用 axis 1.4 和肥皂,用你的例子设置存根的超时,我会这样做:
你的 FooStub 被扩展到 org.apache.axis.client.Stub ,如果你通过 wsdl2java 生成类,你会得到他们已经。
I used to use axis 1.4 and soap as well, to set timeout for stub with your example, I would do as:
Your FooStub is extended to org.apache.axis.client.Stub and if you generated the classes via wsdl2java you would got them already.