---
title: "Short note: SOAP"
subject: "Web Technology"
chapter: 8
key: "semester_7/web_technology:short-note-soap"
source: https://www.bctengineer.com/q/semester_7/web_technology/short-note-soap
site: BCT Engineering
---

# Short note: SOAP

Web Technology · Chapter 8: Web services

- Asked in: 2074 Asoj, 3 marks
- Video: [SOAP Explained | MBSA](https://www.youtube.com/watch?v=NvLJE7juqQs) — Duo Coderz
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/web_technology/short-note-soap
- Whole chapter: https://www.bctengineer.com/md/semester_7/web_technology/chapter-8

## Question

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

## 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.

## Answer

**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
<?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.

```text
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.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is SOAP?
   A. A style language for web pages
   B. An XML-based messaging protocol for exchanging structured information between programs on different platforms
   C. A database engine
   D. A JavaScript framework
   Answer: B. SOAP is a W3C XML-based messaging protocol, mostly over HTTP. (Key point: What SOAP is)

2. Which part of a SOAP message is optional?
   A. Envelope
   B. Body
   C. Header
   D. The XML root
   Answer: C. Envelope is the root and Body carries the call; Header (e.g. security info) is optional. (Key point: SOAP message structure)

3. Why is SOAP generally slower and heavier than REST/JSON?
   A. It uses no network
   B. Its verbose XML messages are large
   C. It works only on one platform
   D. It cannot pass firewalls
   Answer: B. The verbose XML envelope makes messages heavier than REST/JSON. (Key point: SOAP disadvantage)

## Related in other subjects

- [Access overridden members from derived class](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Aaccess-overridden-members) — Object Oriented Programming, chapter 6, asked 2×
- [Access specifiers in inheritance](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Aaccess-specifiers-inheritance) — Object Oriented Programming, chapter 6
- [Random access file transaction processing](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Arandom-access-transaction) — Object Oriented Programming, chapter 8
- [Simple program illustrating OOP concept](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Aoop-simple-program) — Object Oriented Programming, chapter 1
