diff --git a/samples/airline/server/pom.xml b/samples/airline/server/pom.xml
index f1933e5a..b6c90e37 100644
--- a/samples/airline/server/pom.xml
+++ b/samples/airline/server/pom.xml
@@ -151,7 +151,6 @@
org.springframework
spring-jdbc
- runtime
org.springframework
diff --git a/samples/airline/server/src/main/java/org/springframework/ws/samples/airline/ws/AirlineEndpoint.java b/samples/airline/server/src/main/java/org/springframework/ws/samples/airline/ws/AirlineEndpoint.java
new file mode 100644
index 00000000..22e7d5cf
--- /dev/null
+++ b/samples/airline/server/src/main/java/org/springframework/ws/samples/airline/ws/AirlineEndpoint.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright 2005-2011 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.ws.samples.airline.ws;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import javax.xml.bind.JAXBElement;
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.StringUtils;
+import org.springframework.ws.samples.airline.domain.FrequentFlyer;
+import org.springframework.ws.samples.airline.domain.Passenger;
+import org.springframework.ws.samples.airline.domain.ServiceClass;
+import org.springframework.ws.samples.airline.schema.BookFlightRequest;
+import org.springframework.ws.samples.airline.schema.GetFlightsResponse;
+import org.springframework.ws.samples.airline.schema.Name;
+import org.springframework.ws.samples.airline.schema.ObjectFactory;
+import org.springframework.ws.samples.airline.schema.Ticket;
+import org.springframework.ws.samples.airline.schema.support.SchemaConversionUtils;
+import org.springframework.ws.samples.airline.service.AirlineService;
+import org.springframework.ws.samples.airline.service.NoSeatAvailableException;
+import org.springframework.ws.samples.airline.service.NoSuchFlightException;
+import org.springframework.ws.samples.airline.service.NoSuchFrequentFlyerException;
+import org.springframework.ws.server.endpoint.annotation.Endpoint;
+import org.springframework.ws.server.endpoint.annotation.Namespace;
+import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
+import org.springframework.ws.server.endpoint.annotation.RequestPayload;
+import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
+import org.springframework.ws.server.endpoint.annotation.XPathParam;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.joda.time.DateTime;
+import org.joda.time.LocalDate;
+
+import static org.springframework.ws.samples.airline.ws.AirlineWebServiceConstants.*;
+
+/**
+ * Endpoint that handles the Airline Web Service messages using a combination of JAXB2 marshalling and XPath
+ * expressions.
+ *
+ * @author Arjen Poutsma
+ */
+@Endpoint
+public class AirlineEndpoint {
+
+ private static final Log logger = LogFactory.getLog(AirlineEndpoint.class);
+
+ private final ObjectFactory objectFactory = new ObjectFactory();
+
+ private final AirlineService airlineService;
+
+ @Autowired
+ public AirlineEndpoint(AirlineService airlineService) {
+ this.airlineService = airlineService;
+ }
+
+ /**
+ * This endpoint method uses a combination of XPath expressions and marshalling to handle message with a
+ * <GetFlightsRequest> payload.
+ *
+ * @param from the from airport
+ * @param to the to airport
+ * @param departureDateString the string representation of the departure date
+ * @param serviceClassString the string representation of the service class
+ * @return the JAXB2 representation of a <GetFlightsResponse>
+ */
+ @PayloadRoot(localPart = GET_FLIGHTS_REQUEST, namespace = MESSAGES_NAMESPACE)
+ @Namespace(prefix = "m", uri = MESSAGES_NAMESPACE)
+ @ResponsePayload
+ public GetFlightsResponse getFlights(@XPathParam("//m:from") String from,
+ @XPathParam("//m:to") String to,
+ @XPathParam("//m:departureDate") String departureDateString,
+ @XPathParam("//m:serviceClass") String serviceClassString)
+ throws DatatypeConfigurationException {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Received GetFlightsRequest '" + from + "' to '" + to + "' on " + departureDateString);
+ }
+ LocalDate departureDate = new LocalDate(departureDateString);
+ ServiceClass serviceClass = null;
+ if (StringUtils.hasLength(serviceClassString)) {
+ serviceClass = ServiceClass.valueOf(serviceClassString.toUpperCase());
+ }
+ List flights =
+ airlineService.getFlights(from, to, departureDate, serviceClass);
+
+ GetFlightsResponse response = objectFactory.createGetFlightsResponse();
+ for (org.springframework.ws.samples.airline.domain.Flight domainFlight : flights) {
+ response.getFlight().add(SchemaConversionUtils.toSchemaType(domainFlight));
+ }
+ return response;
+ }
+
+ /**
+ * This endpoint method uses marshalling to handle message with a <BookFlightRequest> payload.
+ *
+ * @param request the JAXB2 representation of a <BookFlightRequest>
+ * @return the JAXB2 representation of a <BookFlightResponse>
+ */
+ @PayloadRoot(localPart = BOOK_FLIGHT_REQUEST, namespace = MESSAGES_NAMESPACE)
+ @ResponsePayload
+ public JAXBElement bookFlight(@RequestPayload BookFlightRequest request)
+ throws NoSeatAvailableException, DatatypeConfigurationException, NoSuchFlightException,
+ NoSuchFrequentFlyerException {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Received BookingFlightRequest '" + request.getFlightNumber() + "' on '" +
+ request.getDepartureTime() + "' for " + request.getPassengers().getPassengerOrUsername());
+ }
+ Ticket ticket = bookSchemaFlight(request.getFlightNumber(), request.getDepartureTime(),
+ request.getPassengers().getPassengerOrUsername());
+ return objectFactory.createBookFlightResponse(ticket);
+ }
+
+ /**
+ * Converts between the domain and schema types.
+ */
+ private Ticket bookSchemaFlight(String flightNumber,
+ XMLGregorianCalendar xmlDepartureTime,
+ List