summaryrefslogtreecommitdiff
path: root/Year_3/TSDWL/WSDL/WsBank/src/java/it/dmi/exam/bank/BankOperations.java
blob: 4a64a435697ae855af09e828d2dde7114fd8ba98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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;
    }
    
}