Java Web服务是否触发另一个Web服务?

Java Web服务是否触发另一个Web服务?,java,web-services,jakarta-ee,jax-ws,Java,Web Services,Jakarta Ee,Jax Ws,是否可以从web服务中触发web服务 /** * Web service operation */ @WebMethod(operationName = "bookFlight") public String bookFlight(@WebParam(name = "destination") String destination, @WebParam(name = "seats") int seats) { try { String ret = composite.

是否可以从web服务中触发web服务

/**
 * Web service operation
 */
@WebMethod(operationName = "bookFlight")
public String bookFlight(@WebParam(name = "destination")
String destination, @WebParam(name = "seats")
int seats) {
    try {
        String ret = composite.bookFlight(destination, seats);
            if(composite.checkDistance(destination) > 15)
            {

            }
        return ret;
    } catch (FileNotFoundException_Exception ex) {
        Logger.getLogger(compositeBookings.class.getName()).log(Level.SEVERE, null, ex);
    } catch (InterruptedException_Exception ex) {
        Logger.getLogger(compositeBookings.class.getName()).log(Level.SEVERE, null, ex);
    }
    return null;
}
在空的if函数体中,我需要触发另一个web服务

有人吗

下面是我需要从if语句启动的web服务

/**
 * Web service operation
 */
@WebMethod(operationName = "bookHotel")
public String bookHotel(@WebParam(name = "destination")
String destination, @WebParam(name = "rooms")
int rooms) {        
    try {
        String ret = composite.bookHotel(destination, rooms);            
        return ret;
    } catch (myhotels.InterruptedException_Exception ex) {
        Logger.getLogger(compositeBookings.class.getName()).log(Level.SEVERE, null, ex);
    } catch (myhotels.FileNotFoundException_Exception ex) {
        Logger.getLogger(compositeBookings.class.getName()).log(Level.SEVERE, null, ex);
    }        
  return null;
}

有可能生成要调用的服务的客户端,然后从那里调用该服务


但是,如果您可以访问该服务的代码,请直接使用其服务层,而不是从那里调用SOAP

我可以访问该代码,但是它需要用户输入,就像父服务一样…
但是它需要用户输入,就像父服务一样..
没有得到这一点,你的意思是服务正在接受参数?如果这是您的意思,那么您可以像简单的java方法一样直接传递参数是的,它需要参数。尽管是用户定义的,与第一个相同-@WebParam'sok,尝试使用简单的java方式调用它们,它应该会得到invokedI,因为我已经更新了原始帖子。我正在用netbeans做这件事。当我测试第一个web服务时,我会得到满足web参数的输入框。我只需要调用第二个web服务,或者做一些类似的事情,提示用户输入更多参数。