假设我有以下 2 个 web 服务代码,我想我可以执行以下操作
@WebService
public class WS1 {
@WebMethod
public String hello() {
WS2 ws2 = new WS2();
ws2.method2();
}
@WebService
public class WS2 {
@WebMethod
public String method2() {
//implementation of method2.
}
我已经测试过了,它奏效了。现在的问题是:如果我这样做,是否有任何我不知道的副作用或不可预见的后果?我可以像从服务器端调用任何普通 pojo 一样调用第二个 Web 服务对象吗?