What is the present-day significance of SOAP

Published on Author Code Father
Difference between SOAP and REST? What is the present-day significance of SOAP?

You can not compare REST and SOAP. REST is a architectural style whereas SOAP is a protocol. Unfortunately, REST became colloquial spoken an synonym for RESTful HTTP service, that means a realization of REST styled architecture with HTTP as (application) protocol. REST is based on following principles (constraints and elements) (in brackets the realization in RESTful HTTP) [1].

  • Stateless (HTTP is a stateless protocol)
  • Resource (identified by URIs)
  • Uniform Interface (HTTP Methods)
  • Representation (MIME-TYPE)
  • HATEOS (Hyperlinks)
  • Cache (HTTP Cache)

On the other side many people mean by saying SOAP a web service based on WSDL and SOAP which are part of the W3C web service architecture [2].

  • SOAP is used as protocol to exchange information (basically method name, parameters, return values, data types, …).
  • WSDL a interface definition language to describe the web service.

What is the present-day significance of SOAP*? SOAP is a W3C standard and it’s used as information exchange format in W3C web services. Those web services were – especially during the hype of SOAs (service-orientated archtitectures) around 2010 – and (unfortunately) are still implemented mostly in enterprise applications. This has several reasons. Back then RESTful HTTP was not well-known, it was misunderstood (it’s still misunderstood as you can read here) and SOAP/WSDL are a part of W3C web service protocol stack which provides even more standards e.g. security, orchestration, service discovery etc. Are people still developing new SOAP-based APIs, or it’s mostly a legacy now? So yes, there are still and there will be also in future systems out there which are using SOAP (at least in enterprise systems and behind the doors). But the majority is trying to do some kind of “REST” nowadays. Can someone please correct me if I am wrong about this difference between SOAP and REST? Saying REST is more flexible stateless architecture for data transfer is not a good explanation. Simply spoken REST is an architecture style with specific constraints and elements. Whereas SOAP is a information exchange protocol. Like I already wrote you can not compare them. But you can compare a RESTful HTTP Web Service with a SOAP/WSDL Web Service.   REST is indeed an architectural style. SOAP is a data protocol. The distinction is important; you cannot compare them directly. The primary purpose of REST is to represent resources on the Internet, and to provide mechanisms for discovering them. In contrast, SOAP is used for communicating structured data between computers, and that’s all it really does. Note that you don’t actually need REST to create a client/server relationship between two computers on the Internet. All you need is a mechanism that transfers JSON or XML, and you don’t even need that if you’re willing to be incompatible with everyone else. Nevertheless, SOAP has fallen out of favor for new, public-facing API’s, though it is still commonly used for B2B applications because you can define a “data contract” with it. JSON web services have the virtue of being rather lightweight and flexible, and since Javascript recognizes JSON natively, it’s a natural choice for browsers. But none of that has much to do with REST, really. Further Reading Is REST better than SOAP? (good article, even though it incorrectly calls REST a protocol). The Richardson Maturity Model