A simple Java SOAP client that calls the public Calculator SOAP service from DNE Online.
This project:
- Downloads the WSDL during the Maven build
- Generates SOAP client stubs via
wsimport - Runs a small demo client to call Add/Subtract/Multiply/Divide
- Java 21+
- Maven 3.9+
- Internet access (for the WSDL download + SOAP calls)
src/main/java/com/roy/calc/client/CalculatorClient.java- runnable demo client- Generated SOAP stubs are created at build time under
target/generated-sources/wsimport - The downloaded WSDL is placed in
target/wsdl/calculator.wsdland copied onto the runtime classpath
mvn clean packageRun the main class with Maven exec:
mvn -DskipTests org.codehaus.mojo:exec-maven-plugin:3.5.0:java -Dexec.mainClass=com.roy.calc.client.CalculatorClientExpected output (example):
Add: 30
Subtract: 10
Multiply: 200
Divide: 2
- The WSDL URL used is:
http://www.dneonline.com/calculator.asmx?WSDL - If your network blocks HTTPS/TLS to the service, the build uses HTTP for WSDL download.
- If the SOAP endpoint is blocked, the build may succeed but the run step can fail.