Illustrating multiple schemas in airline sample.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<project name="spring-ws-airline-sample-saaj-client" default="build"
|
||||
xmlns:artifact="urn:maven-artifact-ant">
|
||||
xmlns:artifact="urn:maven-artifact-ant">
|
||||
<property name="bin.dir" value="bin"/>
|
||||
<property name="src.dir" value="src"/>
|
||||
<property name="gen.dir" value="gen"/>
|
||||
@@ -33,7 +33,10 @@
|
||||
output="${gen.dir}"
|
||||
url="${wsdl}">
|
||||
<mapping
|
||||
namespace="http://www.springframework.org/spring-ws/samples/airline/schemas"
|
||||
namespace="http://www.springframework.org/spring-ws/samples/airline/schemas/messages"
|
||||
package="org.springframework.ws.samples.airline.client.axis1"/>
|
||||
<mapping
|
||||
namespace="http://www.springframework.org/spring-ws/samples/airline/schemas/types"
|
||||
package="org.springframework.ws.samples.airline.client.axis1"/>
|
||||
<mapping
|
||||
namespace="http://www.springframework.org/spring-ws/samples/airline/definitions"
|
||||
|
||||
@@ -45,7 +45,7 @@ import javax.xml.transform.stream.StreamResult;
|
||||
*/
|
||||
public class GetFlights {
|
||||
|
||||
public static final String NAMESPACE_URI = "http://www.springframework.org/spring-ws/samples/airline/schemas";
|
||||
public static final String NAMESPACE_URI = "http://www.springframework.org/spring-ws/samples/airline/schemas/messages";
|
||||
|
||||
public static final String PREFIX = "airline";
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ import com.sun.xml.wss.impl.callback.UsernameCallback;
|
||||
*/
|
||||
public class GetFrequentFlyerMileage {
|
||||
|
||||
public static final String NAMESPACE_URI = "http://www.springframework.org/spring-ws/samples/airline/schemas";
|
||||
public static final String NAMESPACE_URI = "http://www.springframework.org/spring-ws/samples/airline/schemas/messages";
|
||||
|
||||
public static final String PREFIX = "airline";
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<property name="bin.dir" value="bin"/>
|
||||
<property name="src.dir" value="src"/>
|
||||
<property name="gen.dir" value="gen"/>
|
||||
<property name="schema" value="../../src/main/webapp/WEB-INF/xsd/airline.xsd"/>
|
||||
<property name="schema" value="../../src/main/webapp/messages.xsd"/>
|
||||
|
||||
<target name="init">
|
||||
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant">
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
<target name="getFlights" depends="build">
|
||||
<java classname="org.springframework.ws.samples.airline.client.sws.AirlineClient" fork="true"
|
||||
failonerror="true">
|
||||
failonerror="true">
|
||||
<classpath refid="classpath"/>
|
||||
<classpath location="${bin.dir}"/>
|
||||
</java>
|
||||
|
||||
@@ -21,13 +21,13 @@ import java.util.Calendar;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.springWs.samples.airline.schemas.BookFlightRequestDocument;
|
||||
import org.springframework.springWs.samples.airline.schemas.BookFlightResponseDocument;
|
||||
import org.springframework.springWs.samples.airline.schemas.Flight;
|
||||
import org.springframework.springWs.samples.airline.schemas.GetFlightsRequestDocument;
|
||||
import org.springframework.springWs.samples.airline.schemas.GetFlightsResponseDocument;
|
||||
import org.springframework.springWs.samples.airline.schemas.Name;
|
||||
import org.springframework.springWs.samples.airline.schemas.Ticket;
|
||||
import org.springframework.springWs.samples.airline.schemas.messages.BookFlightRequestDocument;
|
||||
import org.springframework.springWs.samples.airline.schemas.messages.BookFlightResponseDocument;
|
||||
import org.springframework.springWs.samples.airline.schemas.messages.GetFlightsRequestDocument;
|
||||
import org.springframework.springWs.samples.airline.schemas.messages.GetFlightsResponseDocument;
|
||||
import org.springframework.springWs.samples.airline.schemas.types.Flight;
|
||||
import org.springframework.springWs.samples.airline.schemas.types.Name;
|
||||
import org.springframework.springWs.samples.airline.schemas.types.Ticket;
|
||||
import org.springframework.ws.client.core.support.WebServiceGatewaySupport;
|
||||
|
||||
public class AirlineClient extends WebServiceGatewaySupport {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<artifactId>spring-ws-samples</artifactId>
|
||||
<groupId>org.springframework.ws</groupId>
|
||||
@@ -79,7 +79,7 @@
|
||||
</executions>
|
||||
<configuration>
|
||||
<generatePackage>org.springframework.ws.samples.airline.schema</generatePackage>
|
||||
<schemaDirectory>src/main/webapp/WEB-INF/xsd</schemaDirectory>
|
||||
<schemaDirectory>src/main/webapp/</schemaDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@@ -90,7 +90,7 @@
|
||||
<configuration>
|
||||
<tasks>
|
||||
<java classname="org.apache.openjpa.enhance.PCEnhancer"
|
||||
classpathref="maven.runtime.classpath" dir="target/classes" fork="true"/>
|
||||
classpathref="maven.runtime.classpath" dir="target/classes" fork="true"/>
|
||||
</tasks>
|
||||
</configuration>
|
||||
<goals>
|
||||
|
||||
@@ -25,7 +25,7 @@ public interface AirlineWebServiceConstants {
|
||||
|
||||
String GET_FREQUENT_FLYER_MILEAGE_RESPONSE = "GetFrequentFlyerMileageResponse";
|
||||
|
||||
String NAMESPACE = "http://www.springframework.org/spring-ws/samples/airline/schemas";
|
||||
String MESSAGES_NAMESPACE = "http://www.springframework.org/spring-ws/samples/airline/schemas/messages";
|
||||
|
||||
String GET_FREQUENT_FLYER_MILEAGE_REQUEST = "GetFrequentFlyerMileageRequest";
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.ws.samples.airline.ws;
|
||||
|
||||
import org.springframework.ws.samples.airline.service.AirlineService;
|
||||
import org.springframework.ws.server.endpoint.AbstractDomPayloadEndpoint;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
@@ -37,7 +38,7 @@ public class GetFrequentFlyerMileageEndpoint extends AbstractDomPayloadEndpoint
|
||||
|
||||
protected Element invokeInternal(Element ignored, Document responseDocument) throws Exception {
|
||||
int mileage = airlineService.getFrequentFlyerMileage();
|
||||
Element response = responseDocument.createElementNS(NAMESPACE, GET_FREQUENT_FLYER_MILEAGE_RESPONSE);
|
||||
Element response = responseDocument.createElementNS(MESSAGES_NAMESPACE, GET_FREQUENT_FLYER_MILEAGE_RESPONSE);
|
||||
response.setTextContent(Integer.toString(mileage));
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -23,10 +23,6 @@ import javax.xml.bind.JAXBElement;
|
||||
import javax.xml.datatype.DatatypeConfigurationException;
|
||||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.ws.samples.airline.domain.FrequentFlyer;
|
||||
import org.springframework.ws.samples.airline.domain.Passenger;
|
||||
@@ -46,6 +42,11 @@ import org.springframework.ws.samples.airline.service.NoSuchFrequentFlyerExcepti
|
||||
import org.springframework.ws.server.endpoint.annotation.Endpoint;
|
||||
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.LocalDate;
|
||||
|
||||
/**
|
||||
* Endpoint that handles the Airline Web Service messages using JAXB2 marshalling.
|
||||
* <p/>
|
||||
@@ -73,7 +74,7 @@ public class MarshallingAirlineEndpoint implements AirlineWebServiceConstants {
|
||||
*
|
||||
* @param request the JAXB2 representation of a <code><GetFlightsRequest></code>
|
||||
*/
|
||||
@PayloadRoot(localPart = GET_FLIGHTS_REQUEST, namespace = NAMESPACE)
|
||||
@PayloadRoot(localPart = GET_FLIGHTS_REQUEST, namespace = MESSAGES_NAMESPACE)
|
||||
public GetFlightsResponse getFlights(GetFlightsRequest request) throws DatatypeConfigurationException {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Received GetFlightsRequest '" + request.getFrom() + "' to '" + request.getTo() + "' on " +
|
||||
@@ -107,7 +108,7 @@ public class MarshallingAirlineEndpoint implements AirlineWebServiceConstants {
|
||||
* @param request the JAXB2 representation of a <code><BookFlightRequest></code>
|
||||
* @return the JAXB2 representation of a <code><BookFlightResponse></code>
|
||||
*/
|
||||
@PayloadRoot(localPart = BOOK_FLIGHT_REQUEST, namespace = NAMESPACE)
|
||||
@PayloadRoot(localPart = BOOK_FLIGHT_REQUEST, namespace = MESSAGES_NAMESPACE)
|
||||
public JAXBElement<Ticket> bookFlight(BookFlightRequest request) throws NoSeatAvailableException,
|
||||
DatatypeConfigurationException, NoSuchFlightException, NoSuchFrequentFlyerException {
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
||||
@@ -23,10 +23,6 @@ import javax.xml.bind.JAXBException;
|
||||
import javax.xml.datatype.DatatypeConfigurationException;
|
||||
import javax.xml.transform.Source;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.springframework.oxm.Marshaller;
|
||||
import org.springframework.oxm.support.MarshallingSource;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -46,6 +42,11 @@ import org.springframework.ws.samples.airline.service.NoSuchFrequentFlyerExcepti
|
||||
import org.springframework.ws.server.endpoint.annotation.Endpoint;
|
||||
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
|
||||
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 org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
@@ -85,11 +86,11 @@ public class XPathAirlineEndpoint implements AirlineWebServiceConstants {
|
||||
* @param departureDateString the string representation of the departure date
|
||||
* @param serviceClassString the string representation of the service class
|
||||
*/
|
||||
@PayloadRoot(localPart = GET_FLIGHTS_REQUEST, namespace = NAMESPACE)
|
||||
public Source getFlights(@XPathParam("//tns:from")String from,
|
||||
@XPathParam("//tns:to")String to,
|
||||
@XPathParam("//tns:departureDate")String departureDateString,
|
||||
@XPathParam("//tns:serviceClass")String serviceClassString)
|
||||
@PayloadRoot(localPart = GET_FLIGHTS_REQUEST, namespace = MESSAGES_NAMESPACE)
|
||||
public Source getFlights(@XPathParam("//messages:from")String from,
|
||||
@XPathParam("//messages:to")String to,
|
||||
@XPathParam("//messages:departureDate")String departureDateString,
|
||||
@XPathParam("//messages:serviceClass")String serviceClassString)
|
||||
throws DatatypeConfigurationException {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Received GetFlightsRequest '" + from + "' to '" + to + "' on " + departureDateString);
|
||||
@@ -116,11 +117,11 @@ public class XPathAirlineEndpoint implements AirlineWebServiceConstants {
|
||||
* @param passengerNodes the passenger nodes
|
||||
* @param frequentFlyerNodes the frequent flyer nodes
|
||||
*/
|
||||
@PayloadRoot(localPart = BOOK_FLIGHT_REQUEST, namespace = NAMESPACE)
|
||||
public Source bookFlight(@XPathParam("//tns:flightNumber")String flightNumber,
|
||||
@XPathParam("//tns:departureTime")String departureTimeString,
|
||||
@XPathParam("//tns:passengers/tns:passenger")NodeList passengerNodes,
|
||||
@XPathParam("//tns:passengers/tns:username")NodeList frequentFlyerNodes) throws
|
||||
@PayloadRoot(localPart = BOOK_FLIGHT_REQUEST, namespace = MESSAGES_NAMESPACE)
|
||||
public Source bookFlight(@XPathParam("//messages:flightNumber")String flightNumber,
|
||||
@XPathParam("//messages:departureTime")String departureTimeString,
|
||||
@XPathParam("//messages:passengers/messages:passenger")NodeList passengerNodes,
|
||||
@XPathParam("//messages:passengers/messages:username")NodeList frequentFlyerNodes) throws
|
||||
NoSeatAvailableException, NoSuchFlightException, NoSuchFrequentFlyerException,
|
||||
DatatypeConfigurationException, JAXBException {
|
||||
if (logger.isDebugEnabled()) {
|
||||
@@ -145,8 +146,10 @@ public class XPathAirlineEndpoint implements AirlineWebServiceConstants {
|
||||
continue;
|
||||
}
|
||||
Element passengerElement = (Element) passengerNodes.item(i);
|
||||
Element firstNameElement = (Element) passengerElement.getElementsByTagNameNS(NAMESPACE, "first").item(0);
|
||||
Element lastNameElement = (Element) passengerElement.getElementsByTagNameNS(NAMESPACE, "last").item(0);
|
||||
Element firstNameElement =
|
||||
(Element) passengerElement.getElementsByTagNameNS(MESSAGES_NAMESPACE, "first").item(0);
|
||||
Element lastNameElement =
|
||||
(Element) passengerElement.getElementsByTagNameNS(MESSAGES_NAMESPACE, "last").item(0);
|
||||
Passenger passenger = new Passenger(firstNameElement.getTextContent(), lastNameElement.getTextContent());
|
||||
passengers.add(passenger);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
||||
version="2.4">
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
||||
version="2.4">
|
||||
<display-name>Spring-WS Airline Sample</display-name>
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
@@ -34,13 +34,17 @@
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>mvc</servlet-name>
|
||||
<url-pattern>/</url-pattern>
|
||||
<url-pattern>/flights</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>mvc</servlet-name>
|
||||
<url-pattern>/flights/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
<mime-mapping>
|
||||
<extension>xsd</extension>
|
||||
<mime-type>text/xml</mime-type>
|
||||
</mime-mapping>
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
<welcome-file>index.jsp</welcome-file>
|
||||
</welcome-file-list>
|
||||
</web-app>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
|
||||
|
||||
<!-- ===================== ENDPOINTS ===================================== -->
|
||||
@@ -29,7 +29,7 @@
|
||||
-->
|
||||
|
||||
<bean id="getFrequentFlyerMileageEndpoint"
|
||||
class="org.springframework.ws.samples.airline.ws.GetFrequentFlyerMileageEndpoint">
|
||||
class="org.springframework.ws.samples.airline.ws.GetFrequentFlyerMileageEndpoint">
|
||||
<description>
|
||||
This endpoint handles get frequent flyer mileage requests.
|
||||
</description>
|
||||
@@ -61,7 +61,7 @@
|
||||
<list>
|
||||
<bean class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor"/>
|
||||
<bean class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
|
||||
<property name="schema" value="/WEB-INF/xsd/airline.xsd"/>
|
||||
<property name="schemas" value="/messages.xsd"/>
|
||||
<property name="validateRequest" value="true"/>
|
||||
<property name="validateResponse" value="true"/>
|
||||
</bean>
|
||||
@@ -77,7 +77,7 @@
|
||||
</description>
|
||||
<property name="mappings">
|
||||
<props>
|
||||
<prop key="{http://www.springframework.org/spring-ws/samples/airline/schemas}GetFrequentFlyerMileageRequest">
|
||||
<prop key="{http://www.springframework.org/spring-ws/samples/airline/schemas/messages}GetFrequentFlyerMileageRequest">
|
||||
getFrequentFlyerMileageEndpoint
|
||||
</prop>
|
||||
</props>
|
||||
@@ -115,7 +115,7 @@
|
||||
</description>
|
||||
<property name="namespaces">
|
||||
<props>
|
||||
<prop key="tns">http://www.springframework.org/spring-ws/samples/airline/schemas</prop>
|
||||
<prop key="messages">http://www.springframework.org/spring-ws/samples/airline/schemas/messages</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
@@ -170,11 +170,12 @@
|
||||
</description>
|
||||
<property name="builder">
|
||||
<bean class="org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder">
|
||||
<property name="schema" value="/WEB-INF/xsd/airline.xsd"/>
|
||||
<property name="schema" value="/messages.xsd"/>
|
||||
<property name="schemaLocation" value="messages.xsd"/>
|
||||
<property name="portTypeName" value="Airline"/>
|
||||
<property name="locationUri" value="http://localhost:8080/airline/services"/>
|
||||
<property name="targetNamespace"
|
||||
value="http://www.springframework.org/spring-ws/samples/airline/definitions"/>
|
||||
value="http://www.springframework.org/spring-ws/samples/airline/definitions"/>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<definitions name="airline"
|
||||
xmlns:types="http://www.springframework.org/spring-ws/samples/airline/schemas"
|
||||
targetNamespace="http://www.springframework.org/spring-ws/samples/airline/definitions"
|
||||
xmlns:tns="http://www.springframework.org/spring-ws/samples/airline/definitions"
|
||||
xmlns="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
<types>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<xsd:import namespace="http://www.springframework.org/spring-ws/samples/airline/schemas"
|
||||
schemaLocation="airline.xsd"/>
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="GetFlightsInput">
|
||||
<part element="types:GetFlightsRequest" name="body"/>
|
||||
</message>
|
||||
<message name="GetFlightsOutput">
|
||||
<part element="types:GetFlightsResponse" name="body"/>
|
||||
</message>
|
||||
<message name="BookFlightInput">
|
||||
<part element="types:BookFlightRequest" name="body"/>
|
||||
</message>
|
||||
<message name="BookFlightOutput">
|
||||
<part element="types:BookFlightResponse" name="body"/>
|
||||
</message>
|
||||
<message name="GetFrequentFlyerMileageInput">
|
||||
<part element="types:GetFrequentFlyerMileageRequest" name="body"/>
|
||||
</message>
|
||||
<message name="GetFrequentFlyerMileageOutput">
|
||||
<part element="types:GetFrequentFlyerMileageResponse" name="body"/>
|
||||
</message>
|
||||
<portType name="AirlinePortType">
|
||||
<operation name="GetFlights">
|
||||
<input message="tns:GetFlightsInput"/>
|
||||
<output message="tns:GetFlightsOutput"/>
|
||||
</operation>
|
||||
<operation name="BookFlight">
|
||||
<input message="tns:BookFlightInput"/>
|
||||
<output message="tns:BookFlightOutput"/>
|
||||
</operation>
|
||||
<operation name="GetFrequentFlyerMileage">
|
||||
<input message="tns:GetFrequentFlyerMileageInput"/>
|
||||
<output message="tns:GetFrequentFlyerMileageOutput"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<binding name="AirlineSoapBinding" type="tns:AirlinePortType">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="GetFlights">
|
||||
<soap:operation soapAction="http://www.springframework.org/spring-ws/samples/airline/GetFlights"/>
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="BookFlight">
|
||||
<soap:operation soapAction="http://www.springframework.org/spring-ws/samples/airline/BookFlight"/>
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="GetFrequentFlyerMileage">
|
||||
<soap:operation
|
||||
soapAction="http://www.springframework.org/spring-ws/samples/airline/GetFrequentFlyerMileage"/>
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="AirlineService">
|
||||
<port binding="tns:AirlineSoapBinding" name="AirlinePort">
|
||||
<soap:address location="http://localhost:8080/airline/Airline"/>
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
3
samples/airline/src/main/webapp/index.jsp
Normal file
3
samples/airline/src/main/webapp/index.jsp
Normal file
@@ -0,0 +1,3 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<c:redirect url="/flights"/>
|
||||
51
samples/airline/src/main/webapp/messages.xsd
Normal file
51
samples/airline/src/main/webapp/messages.xsd
Normal file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<schema xmlns="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="http://www.springframework.org/spring-ws/samples/airline/schemas/messages"
|
||||
xmlns:types="http://www.springframework.org/spring-ws/samples/airline/schemas/types"
|
||||
elementFormDefault="qualified">
|
||||
|
||||
<import namespace="http://www.springframework.org/spring-ws/samples/airline/schemas/types"
|
||||
schemaLocation="types.xsd"/>
|
||||
|
||||
<element name="GetFlightsRequest">
|
||||
<complexType>
|
||||
<all>
|
||||
<element name="from" type="types:AirportCode"/>
|
||||
<element name="to" type="types:AirportCode"/>
|
||||
<element name="departureDate" type="date"/>
|
||||
<element name="serviceClass" type="types:ServiceClass" minOccurs="0"/>
|
||||
</all>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="GetFlightsResponse">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="flight" type="types:Flight" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="BookFlightRequest">
|
||||
<complexType>
|
||||
<all>
|
||||
<element name="flightNumber" type="types:FlightNumber"/>
|
||||
<element name="departureTime" type="dateTime"/>
|
||||
<element name="passengers">
|
||||
<complexType>
|
||||
<choice maxOccurs="9">
|
||||
<element name="passenger" type="types:Name"/>
|
||||
<element name="username" type="types:FrequentFlyerUsername"/>
|
||||
</choice>
|
||||
</complexType>
|
||||
</element>
|
||||
</all>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="BookFlightResponse" type="types:Ticket"/>
|
||||
|
||||
<element name="GetFrequentFlyerMileageRequest" nillable="true" type="string"/>
|
||||
|
||||
<element name="GetFrequentFlyerMileageResponse" type="int"/>
|
||||
</schema>
|
||||
@@ -1,52 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<schema xmlns="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="http://www.springframework.org/spring-ws/samples/airline/schemas"
|
||||
xmlns:tns="http://www.springframework.org/spring-ws/samples/airline/schemas"
|
||||
targetNamespace="http://www.springframework.org/spring-ws/samples/airline/schemas/types"
|
||||
xmlns:tns="http://www.springframework.org/spring-ws/samples/airline/schemas/types"
|
||||
elementFormDefault="qualified">
|
||||
|
||||
<element name="GetFlightsRequest">
|
||||
<complexType>
|
||||
<all>
|
||||
<element name="from" type="tns:AirportCode"/>
|
||||
<element name="to" type="tns:AirportCode"/>
|
||||
<element name="departureDate" type="date"/>
|
||||
<element name="serviceClass" type="tns:ServiceClass" minOccurs="0"/>
|
||||
</all>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="GetFlightsResponse">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element name="flight" type="tns:Flight" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="BookFlightRequest">
|
||||
<complexType>
|
||||
<all>
|
||||
<element name="flightNumber" type="tns:FlightNumber"/>
|
||||
<element name="departureTime" type="dateTime"/>
|
||||
<element name="passengers">
|
||||
<complexType>
|
||||
<choice maxOccurs="9">
|
||||
<element name="passenger" type="tns:Name"/>
|
||||
<element name="username" type="tns:FrequentFlyerUsername"/>
|
||||
</choice>
|
||||
</complexType>
|
||||
</element>
|
||||
</all>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="BookFlightResponse" type="tns:Ticket"/>
|
||||
|
||||
<element name="GetFrequentFlyerMileageRequest" nillable="true" type="string"/>
|
||||
|
||||
<element name="GetFrequentFlyerMileageResponse" type="int"/>
|
||||
|
||||
|
||||
<complexType name="Flight">
|
||||
<sequence>
|
||||
<element name="number" type="tns:FlightNumber"/>
|
||||
@@ -114,5 +71,4 @@
|
||||
</restriction>
|
||||
</simpleType>
|
||||
|
||||
|
||||
</schema>
|
||||
</schema>
|
||||
Reference in New Issue
Block a user