如何取消正在运行的 AXIS 1.4 SOAP 请求?
是否可以取消当前正在执行的 SOAP 请求(Axis 1.4、Java 1.6)?
我使用的是 WSDL2Java 生成的接口,因此调用类似于 myProvider.submitMyRequest(request)
。这是同步的,在收到响应之前不会返回。我希望能够根据外部条件中断通话。除了终止运行请求的线程之外,我有什么选择?
Is it possible to cancel a SOAP request (Axis 1.4, Java 1.6) that's currently executing?
I'm using the interfaces generated with WSDL2Java, so the call is something like myProvider.submitMyRequest(request)
. This is synchronous and doesn't return until a response is received. I want to be able to interrupt the call based on an external condition. Short of killing the thread that runs the request, what are my options?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我一直没能找到办法。我发现的最接近的解决方案是在 Stub 类上设置超时(将 myProvider 转换为 Stub),并在一个可以超时的线程中运行请求,而不会阻塞系统的其余部分。
I haven't been able to find a way. The closest solution I found was to set a timeout on the Stub class (cast myProvider to Stub) and run the request in a thread that could be left to timeout without blocking the rest of the system.