Java Reference
In-Depth Information
class as the model. The business methods of our web service will be described by a Ser-
vice Endpoint Interface ( SEI ) named TicketWebService :
package com.packtpub.wflydevelopment.chapter7.boundary;
import javax.jws.WebService;
import java.util.List;
@WebService
public interface TicketWebService {
List<SeatDto> getSeats();
void bookSeat(int seatId);
}
Note
Writing the service interface is always a good practice as it gives a proper client-side view
of our Service methods. The implementation class can then implement the methods
defined in the interface.
We will now implement the interface by providing the business logic to the interface
methods in the DefaultTicketWebService class:
package com.packtpub.wflydevelopment.chapter7.boundary;
import javax.inject.Inject;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;
@WebService(targetNamespace = "http://www.packtpub.com/",
serviceName = "TicketWebService")
Search WWH ::




Custom Search