0
是否可以從Web服務中觸發Web服務?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服務...
任何考生?
這裏是Web服務,我需要從if語句推出
/**
* 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;
}
我有權訪問代碼,但它需要用戶輸入,就像父服務一樣。 – 2011-01-11 17:39:28