GC

T4 Service-oriented software engineering

Service-oriented Architectures

Overview

  • Presenter: Russell Lock, Loughborough University

Topics Covered

  • XML reprise

  • Service-oriented architectures

  • Web services (SOAP/WSDL)

  • RESTful services

  • Service engineering

  • Service composition

  • Aligns with Chapter 18 of the course textbook

  • Exclusion of micro-service architectures in this module

XML

Definition

  • XML: eXtensible Markup Language

  • Acts as a platform-independent meta-language used to format and exchange data

  • Capable of being both human and machine-readable, though verbosity can be a concern

Features

  • Key development towards the Semantic Web

  • Utilizes a nested structure and closing tags for error catching.

  • Example of XML Structure:

    <part number="1976">
        <name>Windscreen Wiper</name>
        <description>The Windscreen wiper automatically removes rain from your windscreen...</description>
    </part>

Web Services Introduction

Definition

  • A web service is an instance of a service that involves the performance offered by one party to another.

  • Defined as a loosely-coupled, reusable software component representing discrete functionality that can be programmatically accessed using standard Internet and XML-based protocols.

Key Characteristics

  • Independent provision of service from the application using it.

  • Management of interactions through loose vs tight coupling.

  • Loose coupling utilizes interfaces to promote interaction.

Characteristics of Web Services

Platform Independence

  • Services can be developed with various programming languages and can be reused across different platforms (e.g., C++, C#, Python, Java).

  • Possibility to wrap existing subsystems as services to gain these benefits.

Benefits of Service-oriented Approach

  • Services can be both internal and external to an organization.

  • Public availability of service information for authorized users.

  • Allows for deferred binding of services until deployment or execution.

  • Facilitates reactive operation.

Additional Benefits

  • Supports opportunistic construction and mashups.

  • Utility computing—service usage can incur costs instead of purchasing components upfront.

  • Offloading computational processing to external services.

  • Preserves investment in legacy systems by wrapping them as services.

Disadvantages of a Web Service Approach

  • Development overhead due to added interfaces.

  • Resource cost associated with extending the life of legacy services by wrapping.

  • Some control is lost when utilizing external services.

Web Services Standards

Overview

  • Development of distributed systems with standalone services.

  • Created standard protocols to enable service communication and data exchange.

Key Components

  • UDDI: A service registry format.

  • BPEL: Manages workflow for service usage.

  • WSDL: Web Service Description Language defining service access.

  • SOAP: Communication protocol at the application layer.

WSDL Specification

Components

  • Interface: Specifies operations supported and message formats.

  • Binding: Maps the abstract interface to concrete protocols.

  • Location: Details the service implementation endpoint.

Example

  • Structure of a WSDL document maps operations to message types and services.

SOAP Protocol

Structure

  • Example of SOAP message:

    <soap:Envelope>
        <soap:Header/>
        <soap:Body/>
    </soap:Envelope>

Downsides to Traditional Web Services

  • Verbose XML formatting can complicate the interface.

  • Complexity of the stack adds development overhead.

  • General services could introduce client compromises.

RESTful Web Services

Characteristics

  • Address criticism of traditional web standards as 'heavyweight'.

  • Based on transferring representations of resources.

  • Simpler than SOAP/WSDL for service implementation.

Differences from SOAP

  • REST does not mandate XML; alternatives like JSON are often used.

  • RESTful services involve lower overhead.

Resources in REST

Definition

  • A resource is a data element such as a catalog or document.

  • Resources can exist in multiple formats from MS WORD to PDF.

Data Exchange Formats

  • Example of JSON:

    { "ID": "A451", "Name": "A Person", "Email": "a.person@people.com", "Country": "France" }
  • Example of XML:

    <Person>
        <ID>A451</ID>
        <Name>A Person</Name>
    </Person>
  • JSON format is shorter and easier to read.

Generic Resource Operations

  1. Create: Bring the resource into existence.

  2. Read: Retrieve a representation of the resource.

  3. Update: Change the value of the resource.

  4. Delete: Make the resource inaccessible.

Web Access Operations

  • POST: Create resource.

  • GET: Read resource.

  • PUT: Update resource.

  • DELETE: Remove resource.

Resource Access

  • REST exposes data through URLs, making it lighter than XML requests.

  • URLs are crafted to access specific resources via web browsers.

HTTP Codes and REST

  • Uses HTTP status codes to report on service status; responses can vary by browser.

Security in REST

  • REST is primarily a communication style, with security handled through HTTPS.

Disadvantages of RESTful Approach

  1. Difficulty in designing RESTful services for complex interfaces.

  2. Stateless nature of REST complicates tracking previous requests.

  3. Lack of standardization in documentation for REST interfaces.

  4. Need for user-implemented service quality monitoring.

Service Testing Problems

Key Issues

  1. External services treated as black boxes.

  2. Modification by providers invalidating tests.

  3. Reliability of tests is reduced due to dynamic binding.

  4. Unpredictability of non-functional service behavior.

  5. Potential expenses involved in testing paid services.

  6. Complexity of simulating failures in external services.

Key Points Summary

  • Service-oriented architecture leverages reusable, standardized services as building blocks.

  • Implemented using XML-based web service standards or RESTful architectures.

  • RESTful architecture utilizes standard HTTP protocols and operations (POST, GET, PUT, DELETE) for service communication.