Skip to main content

Short note: SOAP

Short answer

SOAP (Simple Object Access Protocol) is a W3C XML-based messaging protocol for exchanging structured information over HTTP. A SOAP message contains an Envelope with optional Header and required Body element. It is platform-independent, extensible, supports security and transactions, but is verbosely heavier than REST/JSON.

Write a short note on SOAP (Simple Object Access Protocol).

SOAP (Simple Object Access Protocol) is an XML-based messaging protocol standardised by the W3C that allows programs on different platforms and languages to exchange structured information over a network, mostly over HTTP (also SMTP). It is the protocol used by classic web services, together with WSDL (description) and UDDI (discovery).

SOAP message structure

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
  <soap:Header>   <!-- optional: authentication, transaction info -->
  </soap:Header>
  <soap:Body>     <!-- the actual request or response -->
    <GetPrice>
      <Item>Book</Item>
    </GetPrice>
  </soap:Body>
</soap:Envelope>
  • Envelope: the root element that identifies the XML as a SOAP message.
  • Header (optional): extra information such as security.
  • Body: the call or response data.
  • Fault (inside Body): error information.
Client --SOAP request (HTTP POST)--> Web service
Client <-- SOAP response ----------- Web service

Features

Platform and language independent, extensible, works through firewalls via HTTP, supports security (WS-Security) and reliable messaging.

Disadvantages

Verbose XML makes it slower and heavier than REST/JSON.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Web Technology chapter 8 questions →