Lecture 5: Service-Oriented Architecture (SOA) & Web Services

Learning Objective: Understand the shift from monolithic application design to Service-Oriented Architecture (SOA). Explore the core principles of SOA and the mechanics of traditional SOAP-based Web Services, including WSDL and XML.

1. What is Service-Oriented Architecture (SOA)?

Service-Oriented Architecture (SOA) is a software design style where services are provided to the other components by application components, through a communication protocol over a network. Its basic principles are independent of vendors, products, and technologies.

In SOA, an application is no longer a massive, tightly woven monolith. Instead, business logic is broken down into distinct, reusable "Services". For example, instead of having a billing module locked inside an ERP, you expose a ProcessPayment service that the ERP, the web portal, and the mobile app can all share and reuse.

2. Core Principles of SOA

To qualify as a true SOA environment, the architecture must adhere to several guiding principles:

3. The SOA Architecture: Find, Bind, and Execute

The fundamental operational model of SOA involves three primary actors: the Service Provider, the Service Consumer, and the Service Registry.

Service Registry (UDDI) Service Consumer (Client App) Service Provider (Web Service) 1. PUBLISH 2. FIND 3. BIND & EXECUTE

Figure 1: The SOA Operational Model (Find, Bind, Execute)

4. Implementing SOA: SOAP, WSDL, and XML

While SOA is an abstract architecture, its most famous technical implementation in the 2000s and early 2010s was Web Services. These traditional web services relied on three core W3C standards:

5. Case Study: SOAP Web Service for Student Information

Imagine Udayana University exposing a service so the Library System can verify a student's enrollment status. The Library System (Consumer) sends a SOAP Request to the Academic System (Provider).

The SOAP Request (From Consumer)

Notice the heavy XML formatting, including the standard SOAP Envelope and Body tags.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope 
  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
  xmlns:aca="http://api.unud.ac.id/academic">
   <soapenv:Header/>
   <soapenv:Body>
      <aca:GetStudentStatusRequest>
         <aca:StudentId>1905551042</aca:StudentId>
      </aca:GetStudentStatusRequest>
   </soapenv:Body>
</soapenv:Envelope>

The SOAP Response (From Provider)

The Service Provider processes the logic and returns a tightly structured XML response.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope 
  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
  xmlns:aca="http://api.unud.ac.id/academic">
   <soapenv:Header/>
   <soapenv:Body>
      <aca:GetStudentStatusResponse>
         <aca:StudentId>1905551042</aca:StudentId>
         <aca:Name>I Wayan Sudarma</aca:Name>
         <aca:Status>ACTIVE</aca:Status>
         <aca:Faculty>Engineering</aca:Faculty>
      </aca:GetStudentStatusResponse>
   </soapenv:Body>
</soapenv:Envelope>
Discussion Prompt for Students: Look closely at the SOAP XML request and response above. If you were building a modern mobile app over a slow cellular network, what problems might you face using SOAP and XML? Discuss "payload size," "verbosity," and parsing complexity as a bridge to understanding why the industry moved to REST and JSON.