* [Topics](/en/topics "Topics")
* [Integration](/en/topics/integration "Integration")
* REST vs. SOAP
REST vs. SOAP
=============
Published  April 8, 2019•*3*-minute read
Copy URL
Jump to section
---------------
OverviewRESTSOAPSOAP vs. RESTWhy Red Hat?
Overview
--------
REST and SOAP are 2 different approaches to online data transmission. Specifically, both define how to build [application programming interfaces (APIs)](/en/topics/api), which allow data to be communicated between web applications. Representational state transfer (REST) is a set of architectural principles. Simple object access protocol (SOAP) is an official protocol [maintained by the World Wide Web Consortium (W3C)](https://www.w3.org/TR/soap12/). The main difference is that SOAP is a protocol while REST is not. Typically, an API will adhere to either REST or SOAP, depending on the use case and preferences of the developer.
[Download our API owner's manual](/en/engage/api-owners-manual-ebook)
REST: representational state transfer
-------------------------------------
REST is a set of architectural principles attuned to the needs of lightweight [web services](/en/topics/cloud-computing/what-are-cloud-services) and [mobile applications](/en/topics/mobile). Because it's a set of guidelines, it leaves the implementation of these recommendations to developers.
When a request for data is sent to a REST API, it’s usually done through hypertext transfer protocol (commonly referred to as HTTP). Once a request is received, APIs designed for REST (called RESTful APIs or RESTful web services) can return messages in a variety of formats: HTML, XML, plain text, and JSON. JSON (JavaScript object notation) is favored as a message format because it can be read by any programming language (despite the name), is human- and machine-readable, and is lightweight. In this way, RESTful APIs are more flexible and can be easier to set up.
An application is said to be RESTful if it follows 6 architectural guidelines. A RESTful application must have:
1. A client-server architecture composed of clients, servers, and resources.
2. [Stateless](/en/topics/cloud-native-apps/stateful-vs-stateless) client-server communication, meaning no client content is stored on the server between requests. Information about the session’s state is instead held with the client.
3. Cacheable data to eliminate the need for some client-server interactions.
4. A uniform interface between components so that information is transferred in a standardized form instead of specific to an application’s needs. This is [described by Roy Fielding](https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm), the originator of REST, as “the central feature that distinguishes the REST architectural style from other network-based styles.”
5. A layered system constraint, where client-server interactions can be mediated by hierarchical layers.
6. Code on demand, allowing servers to extend the functionality of a client by transferring executable code (though also reducing visibility, making this an optional guideline).
Red Hat resources
-----------------
[Keep reading](/en/resources "Keep reading")
SOAP: simple object access protocol
-----------------------------------
SOAP is a standard protocol that was first designed so that applications built with different languages and on different platforms could communicate. Because it is a protocol, it imposes built-in rules that increase its complexity and overhead, which can lead to longer page load times. However, these standards also offer built-in compliances that can make it preferable for enterprise scenarios. The built-in compliance standards include [security](/en/topics/security/api-security), atomicity, consistency, isolation, and durability (ACID), which is a set of properties for ensuring reliable database transactions.
Common web service specifications include:
* **Web services security (WS-security)**: Standardizes how messages are secured and transferred through unique identifiers called tokens.
* **WS-ReliableMessaging**: Standardizes error handling between messages transferred across unreliable IT infrastructure.
* **Web services addressing (WS-addressing)**: Packages routing information as metadata within SOAP headers, instead of maintaining such information deeper within the network.
* **Web services description language (WSDL)**: Describes what a web service does, and where that service begins and ends.
When a request for data is sent to a SOAP API, it can be handled through any of the application layer protocols: HTTP (for web browsers), SMTP (for email), TCP, and others. However, once a request is received, return SOAP messages must be returned as XML documents—a markup language that is both human- and machine-readable. A completed request to a SOAP API is not cacheable by a browser, so it cannot be accessed later without resending to the API.
SOAP vs. REST
-------------
Many legacy systems may still adhere to SOAP, while REST came later and is often viewed as a faster alternative in web-based scenarios. REST is a set of guidelines that offers flexible implementation, whereas SOAP is a protocol with specific requirements like XML messaging.
REST APIs are lightweight, making them ideal for newer contexts like [the Internet of Things (IoT)](/en/topics/internet-of-things), mobile application development, and [serverless computing](/en/topics/cloud-native-apps/what-is-serverless). SOAP web services offer built-in security and transaction compliance that align with many enterprise needs, but that also makes them heavier. Additionally, many public APIs, like the Google Maps API, follow the REST guidelines.
Why Red Hat?
------------
Red Hat gives you modular, lightweight, and comprehensive API solutions that are open source, open standards, and available on-premise or in the [cloud](/en/topics/cloud-computing). They're a big part of how you can [optimize your IT](/en/topics/integration/why-choose-red-hat-integration) to be more flexible and deliver value more rapidly.
The official Red Hat blog
-------------------------
Get the latest information about our ecosystem of customers, partners, and communities.
[Keep reading](/en/blog "The official Red Hat blog")
All Red Hat product trials
--------------------------
Our no-cost product trials help you gain hands-on experience, prepare for a certification, or assess if a product is right for your organization.
[Keep reading](/en/products/trials "All Red Hat product trials")
Keep reading
------------
### What is a service mesh?
Read this article to find out more about what a service mesh is, how it works, and the benefits and challenges of implementing a service mesh.
[Read the article](/en/topics/microservices/what-is-a-service-mesh "article | what is a service mesh?")
### What is application integration?
Application integration connects different systems and applications by enabling them to work together through exchanging data and using services.
[Read the article](/en/topics/cloud-native-apps/application-integration "article | What is application integration")
### What is middleware?
Middleware is software that provides common services and capabilities to applications outside of what’s offered by the operating system.
[Read the article](/en/topics/middleware/what-is-middleware "article | what is middleware")
Integration resources
---------------------
### Related content
* Case study
  [HCA Healthcare develops predictive analytics using Red Hat software](/en/resources/hca-healthcare-case-study)
* Blog post
  [Evolving our ServiceNow integration: Sunsetting the Notification Service for more capable alternatives](/en/blog/evolving-our-servicenow-integration-sunsetting-notification-service-more-capable-alternatives)
* Case study
  [GSE and Blaze transform the electricity market with OpenShift](/en/resources/georgian-state-electrosystem-and-blaze-case-study)
* Blog post
  [Beyond the horizon: Navigating the bridge between today's tech and tomorrow's AI](/en/blog/beyond-horizon-navigating-bridge-between-todays-tech-and-tomorrows-ai)
### Related articles
* [What is a service mesh?](/en/topics/microservices/what-is-a-service-mesh)
* [What is application integration?](/en/topics/cloud-native-apps/application-integration)
* [What is middleware?](/en/topics/middleware/what-is-middleware)
* [What is Apache Kafka?](/en/topics/integration/what-is-apache-kafka)
* [Why choose Red Hat for middleware?](/en/topics/middleware/why-choose-red-hat-middleware)
* [What is an API?](/en/topics/api/what-are-application-programming-interfaces)
* [Red Hat OpenShift application services](/en/technologies/cloud-computing/openshift/application-services)
* [What is an independent software vendor (ISV)?](/en/topics/digital-transformation/isv-partners)
* [What is a Kafka service?](/en/topics/integration/what-is-a-kafka-service)
* [What is streaming data?](/en/topics/integration/what-is-streaming-data)
* [Do banking APIs benefit from cloud technology?](/en/topics/api/banking-api)
* [What is a service registry?](/en/topics/integration/what-is-a-service-registry)
* [What is an event mesh?](/en/topics/integration/what-is-an-event-mesh)
* [How microservices support IT integration in healthcare](/en/topics/microservices/microservices-in-healthcare)
* [What is change data capture?](/en/topics/integration/what-is-change-data-capture)
* [Why Red Hat for APIs?](/en/topics/api/why-choose-red-hat-apis)
* [What is service-oriented architecture?](/en/topics/cloud-native-apps/what-is-service-oriented-architecture)
* [What is the Kubernetes API?](/en/topics/containers/what-is-the-kubernetes-api)
* [What is a REST API?](/en/topics/api/what-is-a-rest-api)
* [What is event-driven architecture?](/en/topics/integration/what-is-event-driven-architecture)
* [What is API monetization?](/en/topics/api/what-is-api-monetization)
* [Why choose Red Hat for integration?](/en/topics/integration/why-choose-red-hat-integration)
* [What is API management?](/en/topics/api/what-is-api-management)
* [What is API security?](/en/topics/security/api-security)
* [What is GraphQL?](/en/topics/api/what-is-graphql)
* [What does an API gateway do?](/en/topics/api/what-does-an-api-gateway-do)
* [What is API design?](/en/topics/api/what-is-api-design)
* [What is integration?](/en/topics/integration/what-is-integration)
[More about this topic](/en/topics/integration "More about this topic")