【发布时间】:2011-01-11 17:25:04
【问题描述】:
是否可以从网络服务中触发网络服务?
/**
* 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;
}
【问题讨论】:
标签: java web-services jakarta-ee jax-ws