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

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

问题描述

我在网上通过Soap vs 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-service
http://seanmehan.globat.com/blog/2011/06/ 17 / soap-vs-rest /

根据我的理解,两者都应该是同步的。在这两种情况下,客户端通过肥皂或休息来调用Web服务,客户端等待响应从服务返回。那么,如果soap支持异步行为而休息不支持呢?

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连接上接收响应。同步交换通常更容易实现,并且要求提供者能够在短时间内生成响应,特别是在小于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连接来实现异步消息传递

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连接用于接收回调和响应HTTP响应200 / OK]

Rijoy
https://soascribbles.wordpress.com/

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

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