From 0a58e131ce0d96ecd60c4daf2c41821a625d689b Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 20 Jan 2022 10:43:22 +0100 Subject: wsdl: add examples --- Year_3/TSDWL/WSDL/WsBank/src/conf/MANIFEST.MF | 2 + .../src/java/it/dmi/exam/bank/BankOperations.java | 48 ++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 Year_3/TSDWL/WSDL/WsBank/src/conf/MANIFEST.MF create mode 100644 Year_3/TSDWL/WSDL/WsBank/src/java/it/dmi/exam/bank/BankOperations.java (limited to 'Year_3/TSDWL/WSDL/WsBank/src') diff --git a/Year_3/TSDWL/WSDL/WsBank/src/conf/MANIFEST.MF b/Year_3/TSDWL/WSDL/WsBank/src/conf/MANIFEST.MF new file mode 100644 index 0000000..59499bc --- /dev/null +++ b/Year_3/TSDWL/WSDL/WsBank/src/conf/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/Year_3/TSDWL/WSDL/WsBank/src/java/it/dmi/exam/bank/BankOperations.java b/Year_3/TSDWL/WSDL/WsBank/src/java/it/dmi/exam/bank/BankOperations.java new file mode 100644 index 0000000..4a64a43 --- /dev/null +++ b/Year_3/TSDWL/WSDL/WsBank/src/java/it/dmi/exam/bank/BankOperations.java @@ -0,0 +1,48 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package it.dmi.exam.bank; + +import javax.jws.WebService; +import javax.jws.WebMethod; +import javax.jws.WebParam; + +/** + * + * @author dcariotti + */ +@WebService(serviceName = "BankOperations") +public class BankOperations { + private double amount = 0.0; + + /** + * Web service operation + */ + @WebMethod(operationName = "deposit") + public BankOperations deposit(@WebParam(name = "amount") final double amount) { + this.amount += amount; + + return this; + } + + /** + * Web service operation + */ + @WebMethod(operationName = "getAmount") + public double getAmount() { + return this.amount; + } + + /** + * Web service operation + */ + @WebMethod(operationName = "get") + public BankOperations get(@WebParam(name = "amount") final double amount) { + this.amount -= amount; + + return this; + } + +} -- cgit v1.2.3-18-g5258