1

This question is independent of any framework - it only relates to the SOAP spec; please don't refer to specific language implementations in your answers.

I would like to understand how SOAP correlates requests with their replies, and whether it is possible to send multiple asynchronous queries. e.g. whether it would be possible to request multiple stock quotes from a WSDL web service, without having to wait for the reply of the first request before sending the second one and so on ...

From what I am reading in the HTTP section, it appears that this function is delegated to the transport layer. i.e. that each SOAP request corresponds to a single HTTP connection. Is that correct? If that is the case, isn't this highly inefficient, requiring the creation and teardown of the HTTP layer on each request? Are there other transport layers that would allow asynchronous messaging?

Luciano
  • 2,388
  • 1
  • 22
  • 33
  • Http requests can be asynchronous ( as far as I know, all ajax calls are http and they are asynchronous). Just because HTTP is built on top of TCP, does not mean it is not asynchronous. – Sparrow Sep 07 '17 at 17:57
  • @Sparrow does this mean I can send two `POST` requests sequentially and then receive two responses and correlate these to the original requests? (i.e. without waiting for the first `OK` reply). What is used to correlate the requests to the replies? You can't just rely on ordering here, if for example you the http server has a load balancer - the replies are not guaranteed to be returned in-order, I suppose. – Luciano Sep 08 '17 at 07:57
  • Yes, you can send two POST requests and get two responses, which are not necessarily in the same order of the requests. Every request has some information (such as a token), that is used to identify if the response belong to the request or not. This is a big topic and you need to read about how web servers work. I also suggest reading about AJAX, which is commonly used in web applications. Start from here:https://stackoverflow.com/questions/1510011/how-does-ajax-work – Sparrow Sep 08 '17 at 13:45
  • This one is good too: https://stackoverflow.com/questions/6009206/what-is-ajax-and-how-does-it-work – Sparrow Sep 08 '17 at 13:48
  • @Sparrow right, this is precisely my question - does the SOAP protocol have such a concept of a 'token', or is that left to the application developer? re: AJAX, same question applies - does each `open()` call create a new HTTP or TCP connection that needs to be initialized and cleaned-up after use? – Luciano Sep 11 '17 at 08:31

0 Answers0