3.1 - 3.3 Wire Protocols and the Structure of a SOAP Message
SOAP (Simple Object Access Protocol) is an XML-based, transport-independent messaging protocol specification defined by the W3C for exchanging structured information in decentralized, distributed environments.
Detailed Anatomy of a SOAP Message:
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<!-- Optional: Routing, WS-Security Tokens, Transactions -->
<wsse:Security soap:mustUnderstand="1">...</wsse:Security>
</soap:Header>
<soap:Body>
<!-- Mandatory: Business Payload or SOAP Fault -->
<m:GetEmployeeDetailsRequest xmlns:m="http://example.com/emp">
<m:EmployeeID>101</m:EmployeeID>
</m:GetEmployeeDetailsRequest>
</soap:Body>
</soap:Envelope>
- SOAP Envelope (Mandatory): The root element of every SOAP message that defines the XML document as a SOAP message and declares XML namespaces.
- SOAP Header (Optional): Contains application-specific metadata such as authentication credentials, digital signatures, routing tokens, and transaction contexts. Supports the
mustUnderstand="1"attribute. - SOAP Body (Mandatory): Contains the actual call payload (method name and arguments) or the response payload, or a SOAP Fault if an error occurred.