Updated airline sample to new packages.

This commit is contained in:
Arjen Poutsma
2007-01-14 20:52:46 +00:00
parent b8e3304314
commit d2a1d9d5b8
7 changed files with 29 additions and 26 deletions

View File

@@ -53,6 +53,10 @@
<version>${project.version}</version>
</dependency>
<!-- Spring dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-hibernate3</artifactId>
@@ -138,7 +142,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.1.3</version>
<version>3.2.1.ga</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>

View File

@@ -18,10 +18,9 @@ package org.springframework.ws.samples.airline.security;
import org.jdom.Element;
import org.jdom.Namespace;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.ws.endpoint.AbstractJDomPayloadEndpoint;
import org.springframework.ws.samples.airline.service.AirlineService;
import org.springframework.ws.server.endpoint.AbstractJDomPayloadEndpoint;
/**
* Endpoint that returns the amount of frequent flyer miles for the currently logged in user. Secured via a WS-Security

View File

@@ -29,7 +29,6 @@ import org.joda.time.YearMonthDay;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.ws.endpoint.AbstractJDomPayloadEndpoint;
import org.springframework.ws.samples.airline.domain.Airport;
import org.springframework.ws.samples.airline.domain.Flight;
import org.springframework.ws.samples.airline.domain.FrequentFlyer;
@@ -37,6 +36,7 @@ import org.springframework.ws.samples.airline.domain.Passenger;
import org.springframework.ws.samples.airline.domain.ServiceClass;
import org.springframework.ws.samples.airline.domain.Ticket;
import org.springframework.ws.samples.airline.service.AirlineService;
import org.springframework.ws.server.endpoint.AbstractJDomPayloadEndpoint;
public class BookFlightEndpoint extends AbstractJDomPayloadEndpoint implements InitializingBean {
@@ -116,12 +116,12 @@ public class BookFlightEndpoint extends AbstractJDomPayloadEndpoint implements I
protected Element createFlightElement(Flight flight) {
Element flightElement = new Element("flight", namespace);
flightElement.addContent(new Element("number", namespace).setText(flight.getNumber()));
flightElement.addContent(new Element("departureTime",
namespace).setText(dateTimeFormatter.print(flight.getDepartureTime())));
flightElement.addContent(
new Element("departureTime", namespace).setText(dateTimeFormatter.print(flight.getDepartureTime())));
flightElement.addContent(createAirportElement("from", flight.getFrom()));
flightElement
.addContent(new Element("arrivalTime",
namespace).setText(dateTimeFormatter.print(flight.getArrivalTime())));
.addContent(new Element("arrivalTime", namespace).setText(
dateTimeFormatter.print(flight.getArrivalTime())));
flightElement.addContent(createAirportElement("to", flight.getTo()));
flightElement.addContent(createServiceClassElement(flight.getServiceClass()));
return flightElement;

View File

@@ -20,8 +20,6 @@ import java.util.List;
import org.joda.time.YearMonthDay;
import org.joda.time.chrono.ISOChronology;
import org.springframework.ws.endpoint.AbstractMarshallingPayloadEndpoint;
import org.springframework.ws.samples.airline.schema.Airport;
import org.springframework.ws.samples.airline.schema.Flight;
import org.springframework.ws.samples.airline.schema.GetFlightsRequest;
@@ -31,6 +29,7 @@ import org.springframework.ws.samples.airline.schema.impl.AirportImpl;
import org.springframework.ws.samples.airline.schema.impl.FlightImpl;
import org.springframework.ws.samples.airline.schema.impl.GetFlightsResponseImpl;
import org.springframework.ws.samples.airline.service.AirlineService;
import org.springframework.ws.server.endpoint.AbstractMarshallingPayloadEndpoint;
/**
* Endpoint that returns a list of flights with a given number, and that lie between a given start and end date. It uses

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<beans>
<description>
This application context contains the WS-Security and Acegi beans.
</description>
@@ -25,7 +25,7 @@
<!-- ===================== WS-SECURITY ============================== -->
<bean id="secureMapping" class="org.springframework.ws.soap.endpoint.mapping.SoapActionEndpointMapping">
<bean id="secureMapping" class="org.springframework.ws.soap.server.endpoint.mapping.SoapActionEndpointMapping">
<description>
This SOAP Action endpoint mapping is used for endpoints that are secured via WS-Security. It uses a
securityInterceptor to validate incoming messages.
@@ -33,12 +33,13 @@
<property name="mappings">
<props>
<prop key="http://www.springframework.org/spring-ws/samples/airline/GetFrequentFlyerMileage">
getFrequentFlyerMileageEndpoint</prop>
getFrequentFlyerMileageEndpoint
</prop>
</props>
</property>
<property name="interceptors">
<list>
<bean class="org.springframework.ws.soap.endpoint.interceptor.SoapEnvelopeLoggingInterceptor"/>
<bean class="org.springframework.ws.soap.server.endpoint.interceptor.SoapEnvelopeLoggingInterceptor"/>
<ref local="wsSecurityInterceptor"/>
</list>
</property>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<description>
This application context contains a Spring-WS JMS transport.
@@ -36,7 +35,7 @@
in applicationContext-ws.xml.
</description>
<property name="messageFactory" ref="messageFactory"/>
<property name="messageEndpoint" ref="messageDispatcher"/>
<property name="messageReceiver" ref="messageDispatcher"/>
</bean>
</beans>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<description>
This application context contains the Spring-WS beans.
@@ -13,7 +12,7 @@
</description>
</bean>
<bean id="messageDispatcher" class="org.springframework.ws.soap.SoapMessageDispatcher">
<bean id="messageDispatcher" class="org.springframework.ws.soap.server.SoapMessageDispatcher">
<description>
The MessageDispatcher is responsible for routing messages to endpoints. It uses three endpoint mappings to
determine the endpoint suitable for handling a particular incoming request. Having three mappings is not a
@@ -42,7 +41,7 @@
<property name="wsdl" value="/airline.wsdl"/>
</bean>
<bean id="payloadMapping" class="org.springframework.ws.endpoint.mapping.PayloadRootQNameEndpointMapping">
<bean id="payloadMapping" class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
<description>
This endpoint mapping uses the qualified name of the payload (body contents) to determine the endpoint for
an incoming message. The name GetFlightsRequest with namespace
@@ -61,7 +60,7 @@
</property>
</bean>
<bean id="soapActionMapping" class="org.springframework.ws.soap.endpoint.mapping.SoapActionEndpointMapping">
<bean id="soapActionMapping" class="org.springframework.ws.soap.server.endpoint.mapping.SoapActionEndpointMapping">
<description>
This endpoint mapping uses SOAP Actions to determine the endpoint for an incoming message. The key
http://www.springframework.org/spring-ws/samples/airline/BookFlight is mapped to the bookFlightEndpoint.
@@ -82,7 +81,8 @@
</property>
</bean>
<bean id="validatingInterceptor" class="org.springframework.ws.endpoint.interceptor.PayloadValidatingInterceptor">
<bean id="validatingInterceptor"
class="org.springframework.ws.server.endpoint.interceptor.PayloadValidatingInterceptor">
<description>
This interceptor validates both incoming and outgoing message contents according to the 'airline.xsd' XML
Schema file.
@@ -92,7 +92,7 @@
<property name="validateResponse" value="true"/>
</bean>
<bean id="loggingInterceptor" class="org.springframework.ws.endpoint.interceptor.PayloadLoggingInterceptor">
<bean id="loggingInterceptor" class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor">
<description>
This interceptor logs the message payload.
</description>
@@ -123,7 +123,8 @@
<property name="validating" value="true"/>
</bean>
<bean id="endpointExceptionResolver" class="org.springframework.ws.soap.endpoint.SoapFaultMappingExceptionResolver">
<bean id="endpointExceptionResolver"
class="org.springframework.ws.soap.server.endpoint.SoapFaultMappingExceptionResolver">
<description>
This exception resolver maps exceptions to SOAP Faults. The business logic exceptions
NoSeatAvailableException and NoSuchFlightException are mapped to custom SOAP Fault. Both