Java Reference
In-Depth Information
public List<Seat> getSeats() {
return infoBean.getSeats();
}
@WebMethod
public boolean
bookSeat(@WebParam(name="seatId") int seatId) {
try {
theatreBox.buyTicket(seatId);
return true;
} catch (SeatBookedException e) {
System.out.println("Error!
"+e.getException());
return false;
}
}
}
As you can see, the implementation class contains the
getSeats
method that re-
turns the list of seats that are self generated when the
InfoBean
object is initialized.
The
bookSeat
method will be able to book seats for your web service clients as
well.
Now deploy your web service and verify on the Console that it has been correctly
registered: