SOAP 支持取消呼叫吗?
使用 SOAP 协议时,是否可以使用 SOAP 取消挂起的远程函数调用?
我看到三种不同的情况:
A) 向需要很长时间才能完成的服务发出请求。例如,当复制包含大量文件的目录时,可以取消文件复制循环吗?
B) 发出返回长列表的请求。例如,当查询内存中的一个大用户名列表时,是否可以取消此列表响应的传输?
C) 取消仍在内部呼叫队列中的呼叫;换句话说,在服务器开始处理它之前。当短时间内发出大量异步调用时,可能会发生这种情况。
When using the SOAP protocol, is it possible to cancel a pending remote function call using SOAP?
I see three different situations:
A) Making a request to a service that takes a long time to complete. For example, when copying directory containing a lot of files, can the file copy loop be canceled?
B) Making a request that returns a long list. For example, when querying a big in-memory list of user names, can the transmission of this list-response be canceled?
C) Canceling a call that is still on the internal call queue; in other words, before the server has begun processing it. This can happen when issuing a lot of asynchronous calls in a short time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从客户端的角度来看,取消同步(请求-响应)SOAP 调用与任何其他 HTTP 调用相同 - 只需断开连接并停止侦听响应即可。编写良好的服务器将在继续进行冗长的操作之前检查客户端是否仍然连接(例如,在 .NET 中,服务器将检查 IsClientConnected),如果没有,则应取消操作。
但是,无法以这种方式取消单向调用,因为您已经发送了有效负载并断开连接。取消单向调用需要显式调用 SOAP 服务上的某种取消方法,而 SOAP 服务必须显式支持该方法。
From the client's point of view, cancelling a synchronous (request-response) SOAP call is the same as for any other HTTP call - just disconnect and stop listening for the response. A well written server will check whether the client is still connected before proceeding with lengthy operations (e.g. in .NET the server would check IsClientConnected) and should cancel the operation if not.
One-way calls cannot be cancelled in this manner however, because you've already sent the payload and disconnected. Cancellation of one-way calls would require an explicit call to some sort of cancellation method on the SOAP service, which it would have to explicitly support.