Java Reference
In-Depth Information
QName("", "TicketWebService");
final Service service = Service.create(wsdlURL,
final TicketWebService infoService =
service.getPort(TicketWebService.class);"Got the Service: " + infoService);
infoService.bookSeat(seatId);"Ticket Booked with JAX-WS Service");
final List<SeatDto> list = infoService.getSeats();
private static void dumpSeatList(Collection<SeatDto>
list) {"================= Available Ticket
List ================"); ->;
The service WSDL URL and name are needed for retrieval of the Service object. Fin-
ally, the getPort method will return a proxy to your web service that can be used to test
two basic operations: booking a seat and checking from the Seat list if the seat has actu-
ally been reserved.
This small standalone class has shown how it is possible to use SOAP-based services
from the client-side perspective.
The most interesting part, however, is at the bottom of the Maven output, where the
Ticket list is dumped after booking one seat, as depicted in the following command
apr 01, 2014 1:08:44 AM
Search WWH ::

Custom Search