All Projects
Backend

MicroBank — SOAP Web Service (JAX-WS)

A SOAP web service built with JAX-WS: a standalone 'MicroBank' endpoint exposing currency conversion and account operations, plus a client that consumes it through a stub generated from the WSDL with wsimport.

SOAP
Protocol
JAX-WS
Stack
3
Operations
WSDL stub
Client
Approach

Publish a standalone JAX-WS endpoint, then consume it via contract-first stubs generated from the WSDL

Tech Stack
Java 17JAX-WS (jaxws-rt)SOAP / WSDLwsimportMaven
Keywords
SOAPJAX-WSWSDLwsimportWeb ServicesJava
Deep Dive

A classic SOAP / WSDL exercise: a banking service published as a standalone JAX-WS endpoint, and a separate client that talks to it through contract-first generated stubs.

Structure

microbank-soap-service/   → publishes the @WebService Endpoint on :9090
  └── service/MicroBank   → toMAD, getAccount, getAccounts
  └── entities/Account
microbank-soap-client/    → BankWSClient
  └── proxy/              → classes generated from the WSDL (wsimport)

Operations (@WebService BankWS)

OperationParamReturnsDescription
toMADdouble euroAmountdoubleEUR → MAD conversion (×15)
getAccountint codeAccountone account (random balance)
getAccountsList<Account>all accounts

Workflow

  1. Publish the service: mvn exec:java -Dexec.mainClass=…BankWSApp
  2. Generate the client stub from the live WSDL: wsimport -keep -p …proxy http://localhost:9090/?wsdl
  3. Run the client to invoke the remote operations

The build was modernized: swapped the wrong jaxws-maven-plugin for jaxws-rt, aligned to Java 17, flattened the layout.