2081 3

BIT408 ยท 2081 ยท 10 marks

What is service? Explain the SOAP based web service model? How it differs from RESTful architecture?

What is service? Explain the SOAP based web service model? How it differs from RESTful architecture?[10]

Cloud ComputingChapter 5: Web Services and Data ManagementSOAP based web service model

Quick answer

A service is a self-contained, reusable software component that performs a specific business function and is accessible over a network. Services are designed to be: - Independent: Can operate autonomously - Loosely coupled: Minimal dependencies on other services - Platform and language agnostic: Can be consumed by any client regardless of technology - Discoverable: Can be found and understood by potential consumers - Interoperable: Uses standard protocols and formats for communication

Model Answer: Web Services, SOAP, and REST

What is Service?


SOAP-Based Web Service Model

SOAP (Simple Object Access Protocol) is a protocol for exchanging structured information in web services using XML.

Key Characteristics:

1. Protocol Structure:

  • Uses XML for message formatting
  • Built on HTTP, SMTP, or other transport protocols
  • Follows strict message envelope structure

2. Message Format:

<soap:Envelope>
  <soap:Header>
    <!-- Optional header information -->
  </soap:Header>
  <soap:Body>
    <!-- Actual request/response data -->
  </soap:Body>
</soap:Envelope>

3. Service Description:

  • Uses WSDL (Web Services Description Language) for service definition
  • Describes operations, parameters, return types, and endpoints
  • Enables automatic client stub generation

4. Features:

  • Built-in error handling through SOAP Faults
  • Support for complex data types
  • WS-Security for message-level security
  • Formal contract between client and server

RESTful Architecture

REST (Representational State Transfer) is an architectural style using HTTP methods and standard web conventions.

Key Characteristics:

1. Resource-Oriented:

  • Everything is a resource identified by URI
  • Example: /api/users/123, /api/products/456

2. HTTP Methods:

  • GET: Retrieve resource
  • POST: Create resource
  • PUT: Update resource
  • DELETE: Remove resource

3. Stateless Communication:

  • Each request contains all necessary information
  • Server doesn't store client context

4. Lightweight Format:

  • Typically uses JSON (can use XML)
  • Simpler message structure

Key Differences

AspectSOAPREST
ProtocolXML-based protocolArchitectural style using HTTP
Message FormatComplex XML envelopeSimple JSON/XML
Service DescriptionWSDL (formal contract)OpenAPI/Swagger (informal)
ComplexityHeavy, complexLightweight, simple
PerformanceSlower (XML parsing overhead)Faster (minimal overhead)
CachingLimited (POST-based)Built-in HTTP caching
Learning CurveSteepGentle
Use CaseEnterprise, mission-criticalWeb APIs, mobile apps
Error HandlingSOAP Faults (structured)HTTP status codes
CouplingTightly coupled (contract-based)Loosely coupled

Summary

SOAP is a formal, contract-driven protocol suitable for complex enterprise integrations requiring strict specifications and security. REST is a simpler, more flexible architectural approach ideal for web and mobile applications where performance and ease of use are priorities. Modern development increasingly favors REST due to its simplicity, though SOAP remains relevant in legacy and highly regulated systems.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.