SOAP
Simple Object Access Protocol
In short
SOAP is an XML-based messaging protocol for web services that wraps each request and response in a strict envelope, usually defined by a formal WSDL contract.
What is SOAP?
SOAP is a protocol for exchanging structured messages between applications, most often over HTTP. Every message is an XML document with an Envelope that contains an optional Header, for metadata such as security tokens, and a Body that holds the actual request or response. It was standardized by the W3C in the early 2000s and became the backbone of enterprise web services before REST and JSON took over most new APIs.
A SOAP service is usually described by a WSDL (Web Services Description Language) file, an XML contract listing the operations, their inputs and outputs, and the data types, defined with XML Schema. Tools read the WSDL and generate client code, so calling the service feels like calling a local method, which makes SOAP a form of RPC. A family of extensions known as the WS-* standards adds features such as WS-Security for signing and encrypting messages and WS-ReliableMessaging for guaranteed delivery, and errors come back in a standard Fault element.
SOAP is like sending a formal registered letter in an official envelope with a required form inside: heavier and slower than a quick text message, but precise, verifiable, and hard to misread. It remains common in banking, insurance, telecom, healthcare, government, and payment systems, and in integrations with older enterprise software, where strict contracts and built-in security standards are valued.
The usual comparison is SOAP versus REST. SOAP is a protocol with a fixed XML message format and a formal contract, and it typically sends every call as a POST to a single endpoint. REST is an architectural style that uses URLs for resources, standard HTTP methods and status codes, and any data format, most often JSON. REST is lighter and easier to call from browsers, while SOAP offers stricter typing and standardized message-level security. Despite its original name, SOAP isn't especially simple or object-based, and since version 1.2 the name is officially no longer treated as an acronym.
Key takeaways
- SOAP messages are XML documents with an envelope, an optional header, and a body.
- A WSDL file formally describes the service's operations and data types.
- WS-* standards add message-level security and reliable delivery.
- SOAP is still common in banking, government, telecom, and enterprise integrations.
- SOAP is a strict protocol; REST is a lighter architectural style that usually uses JSON.
Example
<!-- Usually sent with HTTP POST to a single service URL -->
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:acc="http://example.com/accounts">
<soap:Header>
<!-- Metadata such as authentication tokens goes here -->
</soap:Header>
<soap:Body>
<acc:GetBalance>
<acc:AccountId>12345</acc:AccountId>
</acc:GetBalance>
</soap:Body>
</soap:Envelope>Readers ask
What is the difference between SOAP and REST?
SOAP is a formal protocol that always uses XML envelopes and usually a WSDL contract. REST is an architectural style built on resource URLs and standard HTTP methods, typically exchanging JSON, which makes it simpler and lighter for most web APIs.
Is SOAP still used?
Yes. Many banks, payment networks, government agencies, and large enterprise systems still run and depend on SOAP services. Most new public APIs, however, use REST, GraphQL, or gRPC.
What is a WSDL file?
A WSDL (Web Services Description Language) file is an XML document that describes a SOAP service: its operations, message formats, data types, and network address. Tools use it to generate client code automatically.
Often compared
See also
- REST APIBackend & APIs, p. 38A REST API is a web API that exposes data as resources identified by URLs and lets clients read or change them using standard HTTP methods.
- RPCBackend & APIs, p. 39RPC is a communication style in which a program calls a function that runs on another machine as if it were a local function, hiding the network in between.
- APIBackend & APIs, p. 2An API is a set of rules that lets one piece of software request data or actions from another in a predictable, documented way.
- HTTPWeb Development, p. 19HTTP is the protocol that browsers, apps, and servers use to exchange web pages and data through a simple cycle of requests and responses.
- SerializationBackend & APIs, p. 41Serialization is the process of converting in-memory data structures into a format such as JSON or bytes, so they can be stored or sent over a network.
- Web ServerBackend & APIs, p. 46A web server is software, or the machine running it, that accepts HTTP requests from browsers and other clients and responds with pages, files, or data.
- XMLBackend & APIs, p. 48XML (Extensible Markup Language) is a text format for structured data that uses nested tags you define yourself, readable by both people and machines.
- Service-Oriented ArchitectureSoftware Architecture, p. 39Service-oriented architecture builds enterprise software from reusable, network-accessible services that communicate with each other through standard contracts.
Spotted a mistake or something missing on this page?Suggest an edit