Skip to content
IT glossary
BackendUpdated December 3, 2026

SOAP

A protocol that lets applications exchange XML messages. It defines how to wrap requests and responses and how to report errors within a message.

What SOAP standardizes

Imagine a retailer asking a carrier for the status of a shipment. The carrier decides what the operation is called and what information it needs. SOAP defines the outer structure of the message so both sides know where to find the operation's data, optional metadata, and any error reported by the protocol.

What goes into a message?

Every SOAP message has an Envelope and a Body. The envelope is the root XML element, and its namespace identifies the SOAP version. The body carries application data, such as a tracking number in a request or a delivery status in a response. An optional Header, placed before the body, carries metadata. A service may require particular header entries even though SOAP itself makes the header optional. When SOAP reports an error, the body contains a Fault with a code and a description.

Most SOAP APIs you'll encounter use HTTP, commonly with POST for operation calls. But HTTP is not part of the envelope: a transport binding specifies how SOAP messages are carried. The SOAP header is inside the XML, whereas Content-Type and other HTTP headers are outside it.

Example: looking up a shipment

This example shows the XML body of a SOAP 1.2 request:

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
            xmlns:d="urn:example:delivery">
  <s:Body>
    <d:GetShipmentStatus>
      <d:TrackingNumber>12345</d:TrackingNumber>
    </d:GetShipmentStatus>
  </s:Body>
</s:Envelope>

The carrier's API defines GetShipmentStatus and TrackingNumber; SOAP defines Envelope and Body. If the shipment doesn't exist, the carrier might return a normal response with a “not found” result or a SOAP fault, depending on the service contract.

Where SOAP fits

SOAP is common in established enterprise and partner integrations, including banking, insurance, and government services. If a partner gives you a WSDL document, start there: it describes the operations and messages and can specify how and where to call the service. XML Schema (XSD) typically defines the payload's fields and types. Many toolchains can generate client code from WSDL. That convenience does not make WSDL a requirement of SOAP itself: WSDL describes an interface; SOAP messages are what the applications exchange at runtime.

What interviewers ask

A common question is how SOAP differs from REST. SOAP is a messaging protocol with a defined XML envelope. REST is an architectural style, not a message format, and does not require JSON. A REST-style HTTP API might expose a shipment as a resource at GET /shipments/12345; a SOAP API might represent the lookup as an operation in the message body. For debugging questions, distinguish an HTTP failure from a SOAP fault: a gateway can return 502 Bad Gateway without sending any SOAP XML at all.