Soap 如何支持异步调用而 Rest 不支持? [英] How Soap supports asynchronous call while Rest does not?

查看:21
本文介绍了Soap 如何支持异步调用而 Rest 不支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网上浏览了 Soap 与 Rest,发现他们中的大多数人说 Soap 支持异步调用,而 Rest 不支持,但没有得到任何具体的例子.有人可以帮我吗?

I was going thru Soap vs Rest on net and found most of them says Soap supports asynchronous call while Rest does not but did not get any concrete example of that. Can anybody help me here?

这是我所指的资源之一

http://web.archive.org/web/20120421084456/http://www.prescod.net/rest/rest_vs_soap_overview/http://searchsoa.techtarget.com/tip/REST-vs-SOAP-How-to-choose-the-best-Web-servicehttp://seanmehan.globat.com/blog/2011/06/17/soap-vs-rest/

根据我的理解,两者应该是同步的.在这两种情况下,客户端通过soap 或rest 调用Web 服务,客户端等待直到响应从服务返回.那么为什么soap 支持异步行为而rest 不支持呢?

As per my understanding both should be synchronous. In both cases client makes a call to web service either thru soap or rest, client waits till response comes back from service. So how come soap supports asynchronous behaviour while rest does not?

推荐答案

REST 纯粹是一个基于 HTTP 传输的调用,您将收到一个响应,说 200 OK另一方面,

REST is purely an HTTP transport based call and you will receive a response say 200 OK on the other side,

SOAP 使用两种变体,

SOAP uses two varieties,

  • 基于 HTTP 的同步消息
  • 基于 HTTP 的异步消息

通过同步消息传递,请求者发出请求,传输层代码块等待来自提供者的响应.请求者在请求者最初为发送请求而建立的同一 HTTP 连接上接收响应.同步交换通常更容易实现,并且要求 Provider 能够在短时间内生成响应,特别是在小于 HTTP 超时值(通常为 120 秒)的时间内.[使用单个 HTTP 连接,它本身的行为是同步的]

With synchronous messaging, the Requestor makes a request and the transport layer code blocks waiting for a response from the Provider. The Requestor receives the response on the same HTTP connection that the Requestor initially established to send the request. Synchronous exchange is usually easier to implement and requires that the Provider be able to generate a response in a short time, specifically in a time less than the HTTP timeout value(generally 120sec). [A single HTTP Connection is used that itself behaves Synchronously]

通过异步消息传递,一旦请求被响应者确认,请求者就能够释放传输特定资源,知道最终会收到响应.当提供者完成对消息的处理后,它会通过新的 HTTP 连接将响应发送回请求者.[这里我们利用两个 HTTP Connections 来实现异步消息传递

With asynchronous messaging, the Requestor is able to release transport specific resources once the request is acknowledged by the responder, knowing that a response will eventually be received. When the Provider completes the processing of the message it sends a response back to the Requestor over a new HTTP connection. [Here we utilize two HTTP Connections to implement an asynchronous messaging

  • 第一个 HTTP 连接用于发送请求和接收确认 HTTP 响应 200/OK
  • 第二个 HTTP Connection 用于接收回调和响应 HTTP Response 200/OK]

里乔伊https://soascribbles.wordpress.com/

这篇关于Soap 如何支持异步调用而 Rest 不支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆