📖 REST and SOAP
The client-server model alone is not sufficient for the internet to function effectively. Instead, it requires a precise specification of the steps involved in the communication process between clients and servers. This is done via dedicated protocols that ensure security and correctness.
SOAP
SOAP (Simple Object Access Protocol) was the initial protocol that formalized the client-server interaction for the web in 1998. It was widely used in the early 2000s for web services and data exchange.
SOAP is complex and secure, with strict rules, and is often used in situations where high security and reliability are necessary, like banking.
REST
Over time, another more light-weight protocol gained popularity and became the preferred choice for FHIR: REST (Representational State Transfer), first published in 2000 in the dissertation of Roy Fielding.
In 2011, the REST architecture for interacting with the server and the server client model was just a decade old, but already very successful and outgrowing the old SOAP protocol.
REST was adapted as the main exchange mechanism in FHIR.
REST is the most widely used exchange mechanism in HL7® FHIR®1 and was the key to the success of HL7® FHIR®1, but it is not the only possible exchange paradigm. In this learning unit, you will learn about alternative options.
Mataphorical Comparison of REST and SOAP
Sometimes REST and SOAP are compared like this: REST is like sending a quick, flexible text message - easy, fast, and adaptable. SOAP is like sending a formal letter - detailed, structured, and secure, but slower and more complex.
Basic technical Comparision of REST and SOAP
Despite SOAP’s built-in security features, REST has become the preferred choice for HL7® FHIR®, because it offers greater flexibility, scalability, and ease of integration with modern web technologies. REST can achieve high levels of security using standard web protocols like HTTPS[^https], along with robust authentication and authorization methods such as OAuth 2.0, making it suitable for handling sensitive data while providing a more lightweight and adaptable solution compared to SOAP.
In summary, wile SOAP has built-in security features, RESTful APIs like those used in HL7® FHIR® maintain security through other means:
HTTPS for encrypted communication,
OAuth 2.0 and other modern authentication and authorization standards,
Digital signatures and data integrity checks,
Best practices and additional security layers implemented by organizations.