0

I have plenty of times heard REST compared to SOAP, which has been debunked as an apples vs pears comparison (for example, here, on stackoverflow: SOAP vs REST (differences))

Although it is true that they are different things, what this flawed comparison tells me is that old SOAP systems would go hand in hand with a certain architectural style that people incorrectly labelled as SOAP since they were so tightly coupled.

Also, if REST is an architectural style, what is the communication protocol that is mainly used with it?

To sum it up,
REST is to the X protocol as the Y architectural style is to the SOAP protocol.
What are X and Y?

2 Answers2

0

They are both ways of solving a similar architectural problem - loose coupling between services. We could add into this list pub/sub messaging, competing consumer pattern etc. In the case of SOAP and ReST they typically connect web services, SOAP to trigger business transactions brings in concrete implementation guidance and ReST for CRUD operations brings in a pattern only.

On the second point, ReST communication is typically implemented over HTTP, in theory it could run over other communication protocols although I am not aware of any in the mainstream.

Rich Ackroyd
  • 107
  • 5
0

You are correct they are two different web protocols, but they have different purposes.

REST is more modern and easier to understand and program. REST services usually expose a URL-like API. Requests are delivered in HTTP requests and payloads are commonly delivered as JASON structures. Many (if not most) public services use REST.

REST was born as way to access web services in a much simpler way than possible with SOAP.

SOAP is an older and more complex protocol, designed for a wide range of secure services. It is more reliable and more secure - eg its internal protocols can retry if messages are lost, and it also includes strong support for security and database transactions. SOAP can operate using HTTP, SMTP, TCP, UDP protocols, with message bodies being XML encoded.

Depending on the application REST or SOAP could still be the correct choice. They pose their own problems and have their advantages in specific situations. However REST is by far the most common choice, in a growing world of public web based services.

Therefore there is really no correct reply to:

REST is to the X protocol as the Y architectural style is to the SOAP protocol. What are X and Y?

You might say:

REST is to straightforward data delivery services as SOAP is to secure, transactional services (possibly also where complex state is being updated on the server).

Although I am sure many people will want to improve on this :-)

bcperth
  • 2,107
  • 1
  • 8
  • 15