package newpackage; import com.sun.xml.ws.developer.StatefulWebServiceManager; import com.sun.xml.ws.developer.Stateful; import javax.jws.WebMethod; import javax.jws.WebService; import javax.xml.ws.soap.Addressing; @WebService @Stateful @Addressing public class Service { protected final int id; private int number = 0; public Service(int id) { this.id = id; } @WebMethod public synchronized int add(int amount) { number = number + amount; return number; } public static StatefulWebServiceManager manager; }