0

我在 Tomcat 6 中使用 Axis 1.4 来部署我的 Web 服务。我有这样的课:

class helloService{
  ArrayList<String> arr = new ArrayList<String>
  /*Some declarations*/
  public void init(){
     helloService hs= new helloService();
     //File reads,variable initialization and all the init processes
  }

  public void add(int x, int y)
  { return x+y; }
  public void subtract(int x,int y)
  {return x-y;  }
}

我想为客户提供add()subtract(),但是要使用这两种方法(请考虑存在一些操作而不是加减法,这是一个示例),需要先调用init()方法。

部署 Web 服务时如何调用init()方法,因为没有服务器类来调用init()与 RPC/RMI 不同的方法?

4

0 回答 0