Fact-checked by Grok 2 weeks ago

SOAP

SOAP (originally standing for Simple Object Access Protocol) is a lightweight XML-based messaging protocol designed for exchanging structured information between distributed applications in decentralized environments, such as the . It defines a standardized envelope structure to encapsulate messages, including an optional header for metadata and a mandatory body for the primary payload, enabling reliable transmission over various underlying protocols like HTTP. SOAP supports both remote procedure calls (RPC) and document-style messaging, with built-in conventions for encoding data types and handling faults, making it suitable for enterprise-level web services that require formal contracts and security features. The protocol originated in 1998 as an initiative by developers at , including contributions from , DevelopMentor, , and UserLand Software, initially building on concepts to facilitate cross-platform interoperability without introducing new technologies beyond XML and HTTP. The first specification, SOAP 1.1, was submitted as a W3C Note on May 8, 2000, emphasizing simplicity, extensibility, and avoidance of complex features like distributed garbage collection. It evolved into SOAP 1.2, which became a W3C Recommendation in 2007, refining the messaging framework to better support intermediaries, roles for message processing (e.g., "next" or "ultimateReceiver"), and bindings to transport protocols while addressing security considerations like trust evaluation in distributed nodes. Key aspects of SOAP include its processing model, where messages are routed through SOAP nodes that may act as intermediaries, potentially modifying headers or generating faults for errors such as invalid content. The protocol's extensibility allows for features like attachments (via SOAP 1.2 Attachment Feature) and integration with standards such as for authentication and encryption, though it omits built-in reliability or transaction mechanisms, deferring those to extensions or higher-level protocols. While SOAP has been influential in defining web services architectures, particularly in industries requiring robust, standards-compliant integrations like and healthcare, its verbosity and complexity have led to alternatives like for simpler use cases since the early .

Overview

Definition and Purpose

SOAP is a lightweight, XML-based messaging protocol intended for the exchange of structured information in decentralized, distributed environments. It defines a standardized way to encode messages and perform remote interactions between applications, ensuring compatibility across diverse systems without reliance on specific vendor technologies. The primary purpose of SOAP is to enable remote procedure calls (RPC) and document-style messaging, allowing applications to invoke methods or exchange entire documents over networks in heterogeneous environments. By standardizing this communication, SOAP promotes between services built with different programming languages, operating systems, or platforms, facilitating seamless in services architectures. This platform-independent approach addresses key challenges in , such as firewall traversal via HTTP and reduced configuration complexity. SOAP was developed to overcome limitations of earlier protocols like DCOM and CORBA, which were hindered by vendor dependencies and poor suitability for internet-scale deployment. It uses XML as the foundational format for encapsulating messages, providing a flexible and extensible structure for data representation.

Key Characteristics

SOAP employs a stateless, one-way messaging model that forms the foundation of its communication paradigm, enabling the transmission of messages without maintaining session state between sender and receiver. This model supports higher-level patterns such as request-response through the composition of multiple one-way messages, allowing for flexible interaction in distributed systems. Additionally, SOAP's ensures binding neutrality, meaning it is not tied to any specific underlying and can operate over various transports via a standardized . A core feature of SOAP is its extensibility mechanism, achieved through the use of header blocks within the message envelope. These headers allow the addition of protocol features—such as , , or —without modifying the core , promoting decentralized extensibility by different participants in the message path. To manage potential naming conflicts in heterogeneous distributed environments, SOAP leverages XML namespaces throughout its structure, ensuring unambiguous identification of elements and attributes. This XML-based foundation, detailed further in message format specifications, underpins the protocol's structured . SOAP incorporates through a standardized mechanism for error reporting directly embedded in the message format. When processing errors occur, such as a failure to understand a required header or invalid message content, a SOAP Fault element is generated, containing structured details like fault codes (e.g., env:MustUnderstand or env:DataEncodingUnknown) and reasons, which facilitates reliable error handling across intermediaries and endpoints.

History and Development

Origins and Initial Specification

The development of began in 1998 at , where engineers including Satish Thatte and others sought a simpler mechanism for remote procedure calls (RPC) over the web, positioning it as an alternative to the more complex (DCOM). Key contributors such as Don Box of DevelopMentor collaborated closely with , drawing on earlier ideas like Dave Winer's specification released that summer amid internal delays at . This effort aimed to create a lightweight protocol that could leverage the growing ubiquity of HTTP and XML for , avoiding the proprietary and platform-bound nature of DCOM. Early motivations for SOAP centered on addressing the limitations of binary protocols like DCOM, which struggled with firewall traversal due to their non-standard ports and formats, often requiring tunneling or special configurations that hindered . By adopting XML for message encoding and HTTP as the , SOAP enabled seamless passage through firewalls—treating requests as standard —while promoting XML-driven across diverse platforms, languages, and vendors without reliance on binary data exchanges. This approach was seen as essential for enabling web-based RPC in enterprise environments, where existing protocols like CORBA and DCOM had faltered in achieving broad adoption over the . The initial formal specification, SOAP 1.1, emerged as a in early 2000 through collaboration between , , DevelopMentor, and others, before deeper W3C involvement. On May 8, 2000, this version was jointly submitted to the W3C as a technical note by authors including Don Box, Satish Thatte, David Ehnebuske of , and Dave Winer of UserLand Software, proposing the formation of an XML Protocol Working Group to standardize it. Published under the title "Simple Object Access Protocol (SOAP) 1.1," the note outlined a lightweight XML-based for exchanging structured information in decentralized systems, marking SOAP's transition from an internal initiative to an open, industry-backed effort.

Evolution of Versions

SOAP 1.2 marked a significant evolution in the , achieving W3C Recommendation status on June 24, 2003, which formalized its role as a for exchanging structured information in distributed environments. This version introduced the standardized media type "application/soap+xml" for identifying SOAP messages serialized in XML 1.0, improving upon the ambiguous "text/xml" used in earlier iterations and enhancing across systems. Fault handling saw substantial improvements in SOAP 1.2, with the fault element restructured to include mandatory Code and Reason sub-elements, along with optional Node, Role, Detail, and hierarchical Subcode for more granular error reporting and diagnostics. These changes addressed limitations in prior versions by providing clearer mechanisms for conveying error semantics, such as version mismatches via the Upgrade header. SOAP 1.2 also enhanced support for non-HTTP transports by defining an abstract binding framework that allows the to operate over diverse underlying protocols, including SMTP and , without tying it exclusively to HTTP. RPC conventions were refined to specify precise rules for representing remote procedure calls, parameters, and return values in the message body, promoting consistency in procedural-style interactions. To ensure practical interoperability, SOAP 1.2 was designed in alignment with the WS-I Basic Profile, a set of guidelines from the Web Services Interoperability organization that includes conformance tests and best practices for implementing SOAP with WSDL. The Basic Profile versions, starting from 1.0 in 2004, incorporated SOAP 1.2 requirements to facilitate cross-vendor compatibility. The second edition of SOAP 1.2, released as a W3C Recommendation on April 27, 2007, incorporated errata fixes and minor clarifications without altering the core specification. Post-2007, active development of the core SOAP protocol declined, with standardization efforts redirecting toward the WS-* stack of extensions—such as , WS-ReliableMessaging, and WS-Addressing—to address advanced features like security and transactionality. This shift marked the last major W3C update to SOAP itself in 2007. As of 2025, SOAP 1.2 remains the current and maintained W3C standard, continuing to support legacy enterprise systems requiring robust, standardized messaging. However, it has been largely superseded by RESTful APIs in new projects, which offer greater simplicity, lighter payloads, and better alignment with modern web architectures.

Core Concepts and Terminology

Protocol Fundamentals

SOAP serves as a lightweight designed for the exchange of structured information to facilitate the implementation of services in decentralized and distributed environments. It enables communication between applications across various underlying protocols by defining a standardized messaging that supports extensibility and . This operates at a high level of , allowing messages to traverse multiple nodes without being tied to specific mechanisms. Central to SOAP's layer are the concepts of , , and mechanisms, which govern how are and forwarded. A SOAP represents any —such as a , client, or —that participates in handling, including the initial , which originates the , and the ultimate receiver, which performs the final . are that receive, potentially modify, and forward along the , acting in a capacity to support features like , transformations, or aggregation. Each assumes one or more , identified by URIs, such as the "next" role (http://www.w3.org/2003/05/soap-envelope/role/next), which indicates a should and the ; the "none" role, signaling no further ; or the "ultimateReceiver" role, denoting the for delivery. These ensure targeted of components, with mechanisms allowing to forward unprocessed portions of the to subsequent . The message path in SOAP follows a linear progression from the initial sender through zero or more intermediaries to the ultimate receiver, where each adheres to a defined model. Upon receipt, a evaluates header blocks targeted to its , applying any necessary actions before relaying the message if applicable. An optional mustUnderstand attribute on header blocks mandates by assuming the relevant ; if a cannot comprehend or process a header with this attribute set to true, it must generate a fault rather than proceed. This attribute promotes reliability by enforcing comprehension of critical extensions, such as or headers, while allowing optional elements to be ignored without disruption. SOAP messages are encapsulated in XML format to represent this structure, though detailed formatting is specified elsewhere. Fault generation in follows strict rules to handle errors consistently across the protocol layer, using a dedicated SOAP fault element within the message . Standardized fault s provide precise diagnostics, categorized under a top-level value like "Sender" or "Receiver" for the fault's origin, with subcodes offering further granularity. For instance, the VersionMismatch fault code (with subcode http://www.w3.org/2003/05/soap-envelope/VersionMismatch) is generated when a detects an incompatible SOAP version in the , such as a SOAP 1.1 message processed by a 1.2 . Similarly, the MustUnderstand fault code (subcode http://www.w3.org/2003/05/soap-envelope/MustUnderstand) arises if a required header block is not processed, ensuring intermediaries and receivers failures explicitly. Other codes, like DataEncodingUnknown, address issues with unrecognized data formats, all of which halt normal processing and propagate the fault back along the message path unless relayed otherwise. These mechanisms enhance robustness in distributed systems by standardizing error reporting and recovery.

Message Structure and Encapsulation

A message is fundamentally structured as an XML document encapsulated within a mandatory SOAP Envelope element, which serves as the root container for all message content and ensures consistent processing across distributed systems. This envelope allows for the wrapping of arbitrary data, including non-SOAP payloads, by providing a standardized framework that supports extensibility without imposing rigid constraints on the underlying application information. The envelope's , "http://www.w3.org/2003/05/soap-envelope", identifies it uniquely and facilitates in decentralized environments. Within the envelope, the message distinguishes between an optional SOAP Header and a mandatory SOAP Body, enabling flexible organization of control and payload data. Header blocks, contained in the header element, are extensible XML elements designed for auxiliary information such as metadata or processing directives, which may be targeted at intermediaries via attributes like role and mustUnderstand. These blocks support optional processing and can include application-defined extensions, but they are not required for basic message transmission. In contrast, the body element exclusively carries the core application data intended for the ultimate receiver, ensuring that essential payload remains protected and directly accessible without intermediary interference. This separation promotes modularity, as headers handle protocol-level concerns while the body focuses on semantic content. For handling binary or large attachments that could inefficiently inflate XML messages through encoding, SOAP employs specialized mechanisms to optimize transmission. The SOAP with Attachments (SwA) profile utilizes MIME Multipart/Related structures to encapsulate a primary SOAP message alongside zero or more secondary parts, such as images or files, referenced via URIs within the envelope. This approach keeps attachments distinct from the XML envelope, reducing overhead while maintaining SOAP processing rules for the primary part. Complementing SwA, the Message Transmission Optimization Mechanism (MTOM) further enhances binary data handling by serializing optimized octet streams directly, avoiding encoding bloat and integrating seamlessly with XML infosets for better performance in web services. SOAP messages adhere to specific encoding rules to represent data structures, balancing flexibility with schema compliance. The literal encoding style, which is schema-based and the default in SOAP 1.2, allows direct use of application-defined XML without additional layers, promoting through validation. In contrast, the SOAP-encoded style, a graph-based approach using accessors and multi-references for complex data like RPC parameters, is declared via the encodingStyle attribute but is optional in SOAP 1.2, though literal encoding is recommended to simplify implementation and reduce ambiguity.

Technical Specification

Building Blocks

The SOAP message is structured around four primary building blocks that ensure its portability and extensibility across diverse environments. At the core is the , which serves as the encapsulating the entire message and defining its overall framework. The Envelope declares the namespace http://www.w3.org/2003/05/soap-envelope, enabling unambiguous identification of SOAP-specific elements and attributes within XML documents. The Header functions as an optional container for auxiliary information, such as processing directives that guide how intermediate handle the message. It allows for the inclusion of like tokens or transaction identifiers, targeted via attributes such as role (which specifies the intended recipient ) and mustUnderstand (which mandates by the recipient). This supports the protocol's extensibility model without interfering with the core payload. Central to the message is the , which holds the actual application data or invocation details, accommodating both RPC-style calls (where parameters are passed for remote procedure execution) and document-oriented content (such as XML fragments for business documents). The Body can contain multiple child elements, each representing distinct data units, thereby facilitating complex exchanges while maintaining separation from header metadata. For error handling, the Fault element provides a standardized mechanism for reporting issues, always nested within the Body to indicate that the message's primary intent has failed. It comprises sub-elements including (categorizing the fault type, e.g., VersionMismatch or DataEncodingUnknown), Reason (offering a textual explanation in one or more languages), (identifying the URI of the originating SOAP node), and (specifying the role the node assumed when generating the fault). This structure promotes consistent diagnostics across implementations.

Message Format Details

The SOAP message format is fundamentally an XML document structured around the Envelope element, which serves as the root and encapsulates the entire message. The Envelope, defined in the XML schema (soap-envelope.xsd) for the http://www.w3.org/2003/05/soap-envelope namespace from the W3C SOAP 1.2 specification, includes an optional Header element for metadata and processing instructions, and a mandatory Body element for the primary payload or fault information. The schema specifies that the Envelope must be the document's only child element, with its local name fixed as "Envelope" in the namespace http://www.w3.org/2003/05/soap-envelope. Key attributes include soapenv:mustUnderstand (of type xs:boolean), which mandates that targeted header blocks be processed or result in a fault if ignored; soapenv:role (of type xs:anyURI), designating the intended recipient node (e.g., "next" for intermediaries or "ultimateReceiver" for the final destination); and soapenv:relay (of type xs:boolean), indicating whether unprocessed header blocks should be forwarded along the message path. These attributes enable extensible processing while ensuring interoperability. Namespace declarations are integral to the format, with the core namespace http://www.w3.org/2003/05/soap-envelope qualifying all fundamental elements like , , and to avoid conflicts in mixed XML vocabularies. An optional encoding namespace, http://www.w3.org/2003/05/soap-encoding, may be used for serialized data structures within the , though its application is not required for basic literal messages. The encodingStyle attribute on , , or elements (type xs:anyURI) specifies serialization rules when present, allowing for graph-like data representations with references, but it defaults to no encoding if omitted. This namespace separation supports modularity, as SOAP messages can embed content from other XML schemas without ambiguity. For (RPC) representations, the SOAP Body contains a single access named after the (e.g., <m:GetStockPrice>), acting as a struct with child elements for input parameters labeled by their names (e.g., <symbol>IBM</symbol> for an input string). Responses follow a similar , using a named after the with a "Response" (e.g., <m:GetStockPriceResponse>), where output parameters and return values appear as child elements; the return value is specifically accessed via an edge named "result" in the http://www.w3.org/2003/05/soap-rpc unless the is void. Parameters must adhere to XML naming rules, with conventions for mapping non-XML names (e.g., prefixing with underscores). The literal style, which directly uses schema-defined XML without additional encoding attributes, is preferred for its simplicity and direct , contrasting with the optional encoded style that permits complex, referenced data structures but increases parsing overhead. Validation of SOAP messages requires conformance to the W3C XML Schema for the Envelope, ensuring structural integrity without mandating full schema processing for the payload. Messages must serialize to valid XML 1.0, using the XML Infoset abstract model, and avoid DTDs in favor of schema-based definitions for portability. Non-conformant messages, such as those violating namespace rules or attribute types, trigger a "VersionMismatch" or "MustUnderstand" fault as defined in the schema. Implementations are encouraged to validate against the normative schema at http://www.w3.org/2003/05/soap-envelope to verify Envelope integrity, though payload validation depends on application-specific schemas. This rigorous syntax promotes reliable exchange across diverse systems.

Implementation Aspects

Transport Protocols

SOAP messages are primarily transported using the HTTP protocol, which serves as the default binding in the SOAP specification. The HTTP binding employs the method to encapsulate SOAP envelopes within the HTTP entity body, enabling synchronous request-response interactions over the web. In early versions of SOAP, such as SOAP 1.1, the SOAPAction HTTP header was required to indicate the intent of the SOAP request, typically specifying the operation to be invoked on the receiving . This header facilitated intermediary processing and dispatching, though in SOAP 1.2, it was deprecated in favor of an parameter within the Content-Type header for the "application/soap+xml" media type. Beyond HTTP, SOAP supports bindings to other protocols for specialized use cases. The SMTP binding, defined as an illustrative example in the SOAP 1.2 framework, leverages email for asynchronous messaging, where requests and responses are exchanged via separate messages correlated through headers like Message-ID and In-Reply-To. This approach suits scenarios requiring store-and-forward delivery, such as decoupled systems or environments with intermittent connectivity. Additionally, SOAP can directly to for low-level, stream-based connections, allowing messages to be transmitted over raw TCP sockets without higher-level overhead, though no standardized TCP binding exists in the core specification—examples include custom implementations reusing TCP port infrastructure. To enable transport-agnostic addressing and routing, SOAP integrates with WS-Addressing, a W3C recommendation that introduces standardized XML elements for endpoint references and message information headers. WS-Addressing allows SOAP messages to specify destinations (e.g., via wsa:To), replies (wsa:ReplyTo), and faults independently of the underlying transport, decoupling endpoint identification from protocol-specific details like HTTP URLs or SMTP addresses. This facilitates advanced routing through intermediaries and supports multi-hop scenarios across heterogeneous networks. A key consideration in selecting transport protocols for is firewall traversal. HTTP's ubiquity as a allows messages to pass through most corporate and proxies without configuration changes, as they appear as standard HTTP traffic on or 443, unlike that often require exceptions or dedicated ports. This advantage has contributed to HTTP's dominance in deployments, promoting in distributed environments while minimizing modifications.

Binding and Interoperability

SOAP bindings define how abstract service operations described in WSDL are mapped to specific transport protocols and message formats, enabling the concrete realization of web services. The (WSDL) provides a framework for these mappings through its binding elements, which specify details such as the SOAP version, encoding style, and transport protocol for each operation. For instance, a WSDL binding can indicate that an operation uses SOAP 1.2 over HTTP, including how input and output messages are serialized. To promote across diverse implementations, the developed that constrain and related specifications. The WS-I Basic 1.1, published in 2006, refines 1.1, WSDL 1.1, and to ensure compatible by mandating document/literal encoding and prohibiting certain features like encoding. Similarly, the Basic 2.0, released in 2010, extends these guidelines to 1.2 and WSDL 2.0, emphasizing clarifications for reliable message exchange and descriptions. The WS-I concluded operations in 2017, but its continue to guide practices. Compliance with these is verified using tools like the WS-I Analyzer, which examines WSDL documents and message logs against assertions to identify potential issues. Interoperability challenges in often arise from version mismatches between SOAP 1.1 and 1.2, which differ in namespaces and fault handling, leading to errors in cross-version interactions. Encoding style discrepancies, such as the use of RPC/encoded versus document/literal, further complicate compatibility by introducing rules that may not align across platforms. Solutions typically involve strict adherence to literal encoding as prescribed by WS-I profiles, which ensures messages conform directly to XML schemas without additional SOAP-specific , thereby reducing ambiguity and enhancing cross-system reliability. Tooling support facilitates the generation and management of SOAP bindings in practice. The Apache Axis library, a Java-based SOAP engine, automates binding creation from WSDL files using tools like WSDL2Java, supporting both client and server implementations with configurable transport options. In the Microsoft .NET ecosystem, the System.Web.Services.Description namespace provides classes like SoapBinding for defining protocol bindings in WSDL, integrated into ASP.NET Web Services for seamless deployment and invocation. These libraries ensure that developers can produce standards-compliant bindings while addressing interoperability requirements.

Practical Examples

Basic Message Exchange

In the basic SOAP message exchange pattern, a client initiates communication by sending a request message to a , encapsulating a method invocation within the SOAP Envelope. The Envelope serves as the fundamental container for all SOAP messages, comprising an optional Header for processing instructions and a mandatory for the primary . The of the request message contains the call, such as GetStockPrice, along with its parameters expressed as XML elements. For instance, a request to retrieve the stock price for a specific company might include a parameter like the stock symbol. The following XML illustrates a simplified request message for the GetStockPrice method:
xml
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
  <soap:Body>
    <m:GetStockPrice xmlns:m="http://example.org/stock">
      <m:StockSymbol>[IBM](/page/IBM)</m:StockSymbol>
    </m:GetStockPrice>
  </soap:Body>
</soap:Envelope>
This structure ensures the and parameters are serialized in a platform-independent XML format, allowing invocation across distributed systems. Upon receiving the request, the server processes the and generates a response , returning the result in the if successful or a fault if an error occurs. The fault structure, which includes details like fault codes and reasons, provides standardized error reporting but is elaborated further in the protocol's building blocks. A successful response for the GetStockPrice method would embed the return value, such as the price, as a child of the corresponding response method. An example response message might appear as:
xml
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
  <soap:Body>
    <m:GetStockPriceResponse xmlns:m="http://example.org/stock">
      <m:Price>150.25</m:Price>
    </m:GetStockPriceResponse>
  </soap:Body>
</soap:Envelope>
This request-response MEP (Message Exchange Pattern) assumes a synchronous interaction where the client awaits the server's reply. SOAP also supports alternative patterns beyond the standard request-response, including one-way and notification exchanges. In a one-way pattern, the sender dispatches a message without anticipating a reply, suitable for fire-and-forget scenarios like logging events, where the Body carries the payload but no response is generated. Notification follows a similar unidirectional flow but originates from the server to notify the client of state changes, again without requiring acknowledgment. These patterns leverage the same Envelope structure, emphasizing SOAP's flexibility for asynchronous messaging in distributed environments. Intermediary processing enhances SOAP's extensibility by allowing nodes between the initial sender and ultimate receiver to handle specific tasks via Header blocks. Headers contain targeted blocks with attributes like role to direct processing—such as soap:role="http://www.w3.org/2003/05/soap-envelope/next" for the next intermediary—and mustUnderstand="true" to mandate comprehension, triggering a fault if ignored. For example, in a of intermediaries for a stock price request, a Header block might specify transaction s or security tokens, enabling the first intermediary to route based on the ID while the next validates the token, all without altering the Body. Unprocessed headers can be relayed forward if relay="true" is set, ensuring through the chain. This model supports modular processing, such as in enterprise service buses, while maintaining message integrity.

Encapsulated HTTP Example

A SOAP message encapsulated over HTTP typically uses the POST method to send the request to the service , with specific headers to indicate the SOAP format and . The Content-Type header is set to application/soap+xml for SOAP 1.2, and the optional action parameter in the Content-Type or the SOAPAction header (for SOAP 1.1 compatibility) specifies the intended . This binding follows the HTTP rules defined in the SOAP 1.2 specification. Consider a sample request to a service at http://example.com/[weather](/page/Weather) to query the forecast for a specific city. The HTTP request might appear as follows:
[POST](/page/Post-) /weather HTTP/1.1
Host: example.com
Content-Type: application/soap+xml; charset=[utf-8](/page/UTF-8); action="http://example.com/GetWeather"
Content-Length: 456

<?xml version="1.0" encoding="[utf-8](/page/UTF-8)"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
               xmlns:wea="http://example.com/[weather](/page/Weather)">
  <soap:Header/>
  <soap:Body>
    <wea:GetWeather>
      <wea:CityName>[London](/page/London)</wea:CityName>
      <wea:CountryName>[United Kingdom](/page/United_Kingdom)</wea:CountryName>
    </wea:GetWeather>
  </soap:Body>
</soap:Envelope>
The XML payload forms the SOAP envelope, declaring the standard SOAP namespace and a custom namespace for the weather service elements. The Body contains the operation invocation (GetWeather) with parameters for the city and country, enabling the service to process the query. Upon successful processing, the server responds with HTTP status 200 OK, including a similar Content-Type header and the response envelope in the body. For the weather query, this might return forecast data:
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 567

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
               xmlns:wea="http://example.com/weather">
  <soap:Header/>
  <soap:Body>
    <wea:GetWeatherResponse>
      <wea:WeatherData>Partly cloudy, 15°C</wea:WeatherData>
    </wea:GetWeatherResponse>
  </soap:Body>
</soap:Envelope>
If an error occurs, such as an invalid city name, the response uses HTTP status 500 Internal Server Error with a SOAP Fault in the body, detailing the issue via standardized fault codes and reasons. For scenarios involving binary attachments, such as images in a , SOAP with MTOM optimizes transmission by serializing the as the root part of a multipart/related message. The HTTP request uses Content-Type multipart/related; type="application/soap+xml"; boundary="uuid:...", followed by the referencing the attachment via an Include (e.g., xop:Include href="cid:uuid-123") and a separate part for the binary data. This avoids encoding overhead for large payloads.

Security and Extensions

Security Mechanisms

SOAP employs (WS-SeC), an standard that extends SOAP messages with security features embedded in the <wsse:Security> header to ensure end-to-end protection regardless of transport. This specification supports message-level integrity via XML signatures, confidentiality through XML encryption, and authentication using various security tokens, all leveraging standards like XML Digital Signature and XML Encryption. XML signatures in WS-Security provide integrity by digitally signing selected parts of the SOAP envelope, such as the body or custom headers, using algorithms like RSA-SHA256. The signature process involves referencing elements via or attributes and applying canonicalization to normalize the XML before hashing and signing, ensuring that any alteration invalidates the signature. WS-Security mandates the use of Exclusive XML Canonicalization (http://www.w3.org/2001/10/xml-exc-c14n#) to handle issues, preventing canonicalization attacks where attackers exploit prefix redefinitions or external entity inclusions to alter signed content without detection. For confidentiality, WS-Security integrates XML to protect sensitive data within the message. Symmetric s (e.g., AES-128) encrypt elements like the SOAP body, producing <xenc:EncryptedData> and <xenc:CipherData> in the Security header, while the itself may be encrypted asymmetrically using the recipient's public via <xenc:EncryptedKey>. This allows multiple recipients to decrypt portions independently, supporting scenarios like secure multi-party communications. Timestamps enhance security by embedding freshness indicators in the <wsu:Timestamp> element within the Security header, specifying creation time (<wsu:Created>) and optional expiration (<wsu:Expires> ) in UTC format (e.g., 2005-10-13T08:42:00Z). When signed, these prevent replay attacks by allowing recipients to verify the message age against a tolerance window, typically 5 minutes. The UsernameToken profile enables straightforward by including a <wsse:UsernameToken> in the Security header, containing a <wsse:Username> and optional <wsse:Password>. Passwords transmit as plain text (requiring secure transport like TLS) or as a digest: Base64(SHA-1(nonce + created + password)), where the nonce is a Base64-encoded random value unique to the request. This digest method, combined with the <wsu:Created> timestamp, resists offline attacks and replay attempts, as recipients cache nonces for the timestamp's validity period and reject duplicates or expired tokens. SAML integration via the SAML Token Profile allows WS-Security to incorporate Security Assertion Markup Language (SAML) assertions for federated identity. SAML v1.1 or v2.0 assertions, issued by identity providers, embed as <wsse:BinarySecurityToken> (Base64-encoded) or directly as SAML elements in the Security header, carrying subject confirmations, attributes, and authorization decisions. These tokens enable single sign-on across domains in SOAP exchanges, with signatures ensuring assertion integrity and binding to the message via WS-Security references. WS-Security mitigates key vulnerabilities inherent to XML-based messaging, including through exclusive canonicalization, which isolates the signed XML from external influences like document subsets or entity expansions that could enable signature bypassing. Replay protection relies on nonces in tokens and signed timestamps, ensuring one-time use; for instance, UsernameToken nonces prevent token reuse, while overall message nonces in signatures block duplicated requests within defined time bounds. WSDL 2.0 serves as the primary service description language for defining interfaces and bindings, providing an XML-based format to separate abstract service functionality from concrete protocol details such as SOAP messaging. The specification's Interface component outlines operations and fault handling in an abstract manner, while the Binding component maps these to specific protocols like 1.2, including details on message serialization and transmission. This enables developers to describe SOAP-based web services comprehensively, facilitating interoperability across implementations. WS-Policy complements SOAP by offering a to express service capabilities, requirements, and constraints, such as or quality-of-service , through XML-based assertions. It defines alternatives as collections of assertions that indicate what a SOAP service supports or mandates, allowing clients to select compatible interaction patterns during . For instance, WS-Policy can specify requirements for SOAP messages, ensuring consistent policy attachment to WSDL elements or runtime messages. UDDI, or Universal Description, , and Integration, functions as a registry standard for publishing and discovering -based web services, using XML structures to catalog business entities, services, and technical bindings. Its APIs, built on over HTTP, enable inquiries like finding service endpoints via binding templates that reference access points. Though now considered legacy due to the decline of public registries and shift toward decentralized , UDDI 3.0.2 remains influential for private enterprise service catalogs integrated with ecosystems. In modern enterprise settings, hybrid approaches integrate with to leverage SOAP's strengths in complex, stateful transactions alongside REST's simplicity for lightweight interactions, often through platforms that mediate between the two. For example, tools like allow flows to invoke SOAP endpoints for reliable messaging while exposing REST interfaces for broader accessibility, enabling seamless orchestration in mixed-protocol environments.

Evaluation and Usage

Advantages

SOAP's strong typing, achieved through XML schemas, enables precise definition and validation of data structures, ensuring reliable and error-free exchanges in (B2B) scenarios where is paramount. This schema validation mechanism allows service providers to enforce contracts that prevent mismatches in data types and formats, reducing failures across diverse systems. The protocol's built-in extensibility, supported by XML namespaces and modular adjuncts, facilitates the addition of custom features without disrupting core functionality, promoting long-term in evolving enterprise architectures. As a W3C Recommendation, SOAP adheres to rigorous standards that ensure compatibility and future-proofing, allowing organizations to update services incrementally while preserving existing integrations. SOAP incorporates robust error handling via standardized fault elements, which detail codes, reasons, and details in a structured XML , enabling systematic diagnosis and recovery in distributed environments. Furthermore, integration with WS-AtomicTransaction provides support through coordination protocols that guarantee atomicity, , , and (ACID) properties for distributed operations, ensuring all-or-nothing outcomes in multi-system interactions. In heterogeneous systems, SOAP excels in by abstracting platform and language differences, allowing seamless communication between disparate technologies such as and .NET environments. This capability has been proven in regulated industries; for instance, in , SOAP underpins secure in banking systems. In healthcare, it supports for electronic health records and data transmission, as demonstrated by CDC-recommended implementations for EHR-IIS integration using HL7 over SOAP.

Criticisms and Limitations

One major criticism of is its verbosity, stemming from its reliance on XML for message formatting, which results in significantly larger payloads compared to lighter alternatives like used in APIs. This overhead can lead to increased consumption and slower transmission times, particularly in high-volume or resource-constrained environments. For instance, SOAP messages often include extensive structures and schemas that inflate data size compared to equivalent REST representations. SOAP's complexity is another frequent point of , as it requires developers to navigate a steep due to the intricate WS-* standards stack, including specifications for , transactions, and reliability, which demand specialized tooling and configuration. Unlike simpler protocols, implementing a full SOAP service involves defining contracts via WSDL and handling multiple layers of abstraction, making it less accessible for rapid in agile settings. This complexity often results in longer cycles and higher maintenance costs for teams unfamiliar with the ecosystem. As of 2025, is increasingly viewed as a legacy technology with limited adoption in new web and architectures, where and are favored for their simplicity and alignment with modern practices. While persists in established enterprise domains like banking and healthcare, most contemporary projects opt for alternatives to avoid its overhead, leading to deprecation efforts in platforms like and . This shift reflects a broader industry preference for lightweight, scalable protocols in cloud-native environments. Security risks associated with SOAP arise primarily from its XML foundation, which can expose systems to parsing vulnerabilities such as XML External Entity (XXE) attacks if parsers are not securely configured to disable external entity resolution. These risks include potential data leakage or denial-of-service through malicious entity expansions, underscoring the need for rigorous validation in XML processing. Additionally, improper implementation of SOAP's security extensions can amplify threats like injection attacks, where untrusted input manipulates message structures.

References

  1. [1]
    Simple Object Access Protocol (SOAP) 1.1 - W3C
    May 8, 2000 · SOAP is a lightweight, XML-based protocol for exchanging information in a distributed environment. It has an envelope, encoding rules, and RPC ...
  2. [2]
    SOAP Version 1.2 Part 1: Messaging Framework (Second Edition)
    Apr 27, 2007 · SOAP Version 1.2 (SOAP) is a lightweight protocol intended for exchanging structured information in a decentralized, distributed environment. It ...
  3. [3]
    A Brief History of SOAP - XML.com
    Apr 4, 2001 · SOAP started in 1998, focused on type systems, and was delayed by Microsoft. It shipped in 1999, and its intent was to send XML documents to ...
  4. [4]
    SOAP 1.2 Attachment Feature - W3C
    Jun 8, 2004 · This document defines a SOAP feature that represents an abstract model for SOAP attachments. It provides the basis for the creation of SOAP bindings that ...
  5. [5]
    SOAP Version 1.2 Part 0: Primer (Second Edition) - W3C
    Apr 27, 2007 · SOAP is fundamentally a stateless, one-way message exchange paradigm, but applications can create more complex interaction patterns (e.g., ...
  6. [6]
    [PDF] Chapter 4 SOAP: Simple Object Access Protocol
    SOAP supports two possible communication styles: – remote procedure call (RPC) and. – document (or message). RPC-style interaction.
  7. [7]
    A Young Person's Guide to The Simple Object Access Protocol
    Oct 24, 2019 · The guiding principle behind SOAP is to "first invent no new technology." SOAP uses two existing and widely deployed protocols: HTTP and XML.
  8. [8]
  9. [9]
  10. [10]
  11. [11]
  12. [12]
  13. [13]
  14. [14]
    [PDF] The SOAP Protocol - Higher Education | Pearson
    SOAP is a simple, flexible, and extensible XML protocol for machine-to-machine interaction, and a specification for cross-platform XML distributed computing.
  15. [15]
    Simple Object Access Protocol (SOAP) - Cover Pages
    Jul 22, 2003 · According to Don Box's Brief History of SOAP, Winer grew impatient with corporate delays. In July, 1998, Winer posted the specification for XML- ...
  16. [16]
  17. [17]
  18. [18]
  19. [19]
  20. [20]
  21. [21]
  22. [22]
    SOAP Specifications - W3C
    A full list of SOAP specifications, please refer to the W3C XML Protocol Working Group and the list of W3C Technical Reports.Simple Object Access Protocol · SOAP Version 1.2 Part 0 · Messaging FrameworkMissing: definition | Show results with:definition
  23. [23]
    SOAP vs REST - Difference Between API Technologies - AWS
    SOAP is a protocol, while REST is an architectural style. This creates significant differences in how SOAP APIs and REST APIs behave.
  24. [24]
  25. [25]
  26. [26]
    SOAP Version 1.2 Part 2: Adjuncts (Second Edition) - W3C
    Apr 27, 2007 · SOAP Version 1.2 is a lightweight protocol intended for exchanging structured information in a decentralized, distributed environment.Missing: enhancements | Show results with:enhancements
  27. [27]
    Web Services Description Language (WSDL) Version 2.0 Part 1 - W3C
    Jun 26, 2007 · This specification defines a language for describing the abstract functionality of a service as well as a framework for describing the concrete ...Introduction · Prefixes and Namespaces... · Notation · The Binding Component
  28. [28]
    Web Services Description Language (WSDL) 1.1 - W3C
    Mar 15, 2001 · WSDL is an XML format for describing network services as communication endpoints, defining services as collections of network endpoints.
  29. [29]
    Web Services Description Language (WSDL) Version 2.0 SOAP 1.1 ...
    Jun 26, 2007 · This binding is intended to ease the migration from WSDL 1.1 to WSDL 2.0 for implementers describing services that use SOAP 1.1 protocol.
  30. [30]
    Basic Profile Version 1.1 - Web Services Interoperability Organization
    Apr 10, 2006 · This document defines the WS-I Basic Profile 1.1, consisting of a set of non-proprietary Web services specifications, along with clarifications, refinements, ...
  31. [31]
    Basic Profile Version 2.0 - Web Services Interoperability Organization
    Nov 9, 2010 · This document defines the WS-I Basic Profile 2.0, consisting of a set of non-proprietary Web services specifications, along with clarifications, refinements, ...Introduction · Profile Conformance · Messaging · Service Description
  32. [32]
    Deliverables from the Testing Tools Working Group
    The WS-I Testing Tools are designed to help developers determine whether their Web services are conformant with WS-I profile guidelines. This updated version is ...
  33. [33]
    [PDF] WS-I Testing Tools Specification Part 2 - Analyzer Tool Design
    Jun 13, 2005 · The following list is a functional overview of the analyzer tool for the basic profiles: • Process the input parameters to locate configuration ...
  34. [34]
    Differences in SOAP versions - IBM
    SOAP Version 1.2 Part 0: Primer W3C Recommendation 24 June 2003 · WSDL 1.1 Binding Extension for SOAP 1.2 · SOAP Version 1.2 Part 1: Messaging Framework W3C ...
  35. [35]
    User's Guide - Apache Axis
    Axis is essentially a SOAP engine -- a framework for constructing SOAP processors such as clients, servers, gateways, etc.
  36. [36]
    Apache Axis2 User's Guide- Creating Clients
    Axis2 clients are created using WSDL definitions, with options like ADB, XMLBeans, and JiBX. ADB is simple, while XMLBeans and JiBX offer more flexibility.
  37. [37]
    SoapBinding Class (System.Web.Services.Description)
    This class specifies that the data transmission will use the SOAP protocol version 1.1. For more information about specifying protocols for XML Web services, ...Definition · Examples
  38. [38]
    Web Services Security Code Specification - OASIS Open
    This specification describes enhancements to SOAP messaging to provide message integrity and confidentiality.
  39. [39]
    Web Services Security v1.1 - OASIS Open
    Proposing a standard set of SOAP extensions that can be used when building secure Web services to implement message content integrity and confidentiality.
  40. [40]
    Web Services Security Username Token Profile Version 1.1.1
    This document describes how to use the Username Token with the Web Services Security (WSS) specification.
  41. [41]
    Web Services Security Username Token - OASIS Open
    One method of preventing replay is to use a nonce as mentioned previously. Generally it is also necessary to use a timestamp to put a ceiling on the number of ...
  42. [42]
    Web Services Security SAML Token Profile Version 1.1.1
    This document describes how to use Security Assertion Markup Language (SAML) V1.1 and V2.0 assertions with the Web Services Security SOAP Message Security ...
  43. [43]
    Web Services Policy 1.5 - Framework - W3C
    Sep 4, 2007 · The Web Services Policy 1.5 - Framework provides a general purpose model and corresponding syntax to describe the policies of entities in a Web services-based ...
  44. [44]
    UDDI Version 3.0.2
    Summary of each segment:
  45. [45]
  46. [46]
    Web Services Atomic Transaction 1.2 - OASIS Open
    WS-AtomicTransaction defines an Atomic Transaction coordination type for short, distributed activities with an "all-or-nothing" property, enabling ...
  47. [47]
    What is SOAP? - HarmonyERP
    Jul 26, 2024 · Standardized Protocol. SOAP is a protocol standardized by the W3C. This standard enables interoperability of different systems and applications.
  48. [48]
    [PDF] SOAP Transport Protocol: Enhancing EHR-IIS Interoperability - CDC
    The recommendation of SOAP web services has a number of effects on the IIS and EHR communities. IIS that have implemented a SOAP service have been able to ...
  49. [49]
    Key Differences Between REST and SOAP APIs - Postman Blog
    May 4, 2023 · Advantages of SOAP · Extensibility: Developers can extend and add functionality as needed by using XML namespaces and custom header elements.
  50. [50]
    SOAP vs REST: 9 Key Differences & When to Use Each in 2025
    Jul 18, 2025 · Most APIs today use REST, while SOAP lives on in older enterprise systems. SOAP is a tightly controlled protocol with a formal contract and ...Missing: 2024 superseded
  51. [51]
    REST API vs. SOAP: The Ultimate 2025 Guide for Developers and ...
    May 7, 2025 · ❓ "Is SOAP dead in 2025?" No. SOAP still powers 15% of APIs in banking, healthcare, and ERP. ❓ "Can REST APIs be as secure as SOAP ...<|separator|>
  52. [52]
    XML Security - OWASP Cheat Sheet Series
    Malformed XML Documents: Exploiting vulnerabilities that occur when applications encounter XML documents that are not well-formed. Invalid XML Documents ...Introduction · Dealing with malformed XML... · Dealing with invalid XML...
  53. [53]
    Cloud security and authentication vulnerabilities in SOAP protocol
    Current research highlights the threats of XXE attacks, where XML parsers resolving external entities may inadvertently leak sensitive information or run ...