Enter NorthAirWS as the name for our web service. Provide a valid Package name.
You can either create a web service from scratch or use an existing session bean.
After creating the web service, add a web service operation in NorthAirWS.java as
shown in the following code snippet:
@WebMethod(operationName = "processItinerary")
public String processItinerary(@WebParam(name = "firstName")
String firstName, @WebParam(name = "lastName")
Building a Sample Application
[ 228 ]
String lastName, @WebParam(name = "source")
String source, @WebParam(name = "destination")
String destination, @WebParam(name = "travelDate")
String travelDate, @WebParam(name = "seatPreference")
String seatPreference, @WebParam(name = "foodPreference")
String foodPreference, @WebParam(name = "guestID")
String guestID, @WebParam(name = "seqID")
int seqID) {
//TODO write your implementation code here:
return "Processed Reservation";
}
processItinerary operation receives itinerary information and sends a
confirmation message back to the client. You can modify the code to add any specific
reservation implementation. Right-click on NorthAirEJB module and select Build to
compile the source file. Then right-click on NorthAirEJB and select Undeploy and
Deploy. This action will deploy the web service in the target server.
Pages:
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203