Skip to content

nicko-08/xml-soap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ATM SOAP Service (Spring Boot)

A production-style SOAP web service built with Spring Boot that simulates core ATM operations such as withdrawals, deposits, balance inquiries, and transfers.

This project demonstrates enterprise backend patterns including SOAP messaging, fault handling, transaction management, idempotency, and audit logging.


Features

  • SOAP 1.2 Web Service (Spring Web Services)
  • WSDL generation from XSD schemas
  • Account operations:
    • Withdraw
    • Deposit
    • Balance Inquiry
    • Transfer
  • One-way event handling (SessionEndedEvent)
  • Global SOAP Header validation (TransactionHeader)
  • Idempotency via transaction tracking
  • Structured fault handling:
    • Business Faults (client errors)
    • Technical Faults (system errors)
  • Audit logging with separate transaction scope
  • PostgreSQL integration via JPA

Tech Stack

  • Java 17+
  • Spring Boot
  • Spring Web Services (SOAP)
  • Spring Data JPA
  • PostgreSQL
  • JAXB (XML binding)

Architecture Overview

Client (SOAP XML)
↓
MessageDispatcherServlet (/ws/*)
↓
Endpoint (AtmEndpoint)
↓
Service Layer (AccountService)
↓
Repository Layer (JPA)
↓
PostgreSQL

Cross-cutting concerns:

  • Interceptors → Header validation
  • Exception Resolver → SOAP Fault mapping
  • Audit Service → Independent transaction logging

SOAP Endpoint

WSDL available at: http://localhost:8080/ws/atm.wsdl


Required SOAP Header

All requests must include:

<TransactionHeader xmlns="http://bank.com/atm/header">
    <transactionId>123456</transactionId>
    <clientTimestamp>2026-03-25T10:00:00</clientTimestamp>
    <channel>ATM</channel>
</TransactionHeader>

Example Operations

Withdraw

<WithdrawRequest xmlns="http://bank.com/atm">
    <accountNumber>11111</accountNumber>
    <amount>100.00</amount>
</WithdrawRequest>

Fault Handling

Business Fault (Client Error)

  • Missing header
  • Invalid amount
  • Insufficient funds
  • Duplicate transaction

Technical Fault (Server Error)

  • Unexpected system failures
  • Database issues

All faults are returned as structured SOAP responses.

Idempotency

Transactions are tracked via transactionId.

Duplicate requests are rejected to prevent double processing.


Audit Logging

Every operation is recorded in the audit_logs table using a separate transaction.


Running the Project

1. Clone

git clone <repo-url>
cd atm-soap-service

2. Configure Environment

Create:

cp application.example.yaml application.yaml

3. Run

./mvnw spring-boot:run

4. Access WSDL

http://localhost:8080/ws/atm.wsdl

🔷 Sample Data

The system auto-seeds:

Account Balance
11111 5000.00
22222 100.00

Project Structure

config/        → SOAP config, interceptors, fault mapping
endpoint/      → SOAP endpoints
service/       → business logic
repository/    → database access
entity/        → JPA entities
model/         → request/response objects
fault/         → SOAP fault models
exception/     → business & technical exceptions
xsd/           → schema definitions

Highlights

  • Enterprise-level SOAP service design

  • Strong separation of concerns

  • Robust error handling strategy

  • Production-style logging and validation

  • Idempotent transaction processing

Future Improvements

  • Swagger (REST wrapper if needed)

  • Integration tests

  • CI/CD pipeline

  • Authentication (WS-Security)

About

Enterprise-style Spring Boot SOAP API for ATM operations with WSDL contracts, idempotent transactions, and audit logging.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages