Skip to content

Commit 8640c3b

Browse files
committed
Migrated airline axis1 client to maven
1 parent a47e15a commit 8640c3b

File tree

4 files changed

+160
-3
lines changed

4 files changed

+160
-3
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:sch0="http://www.springframework.org/spring-ws/samples/airline/schemas/messages" xmlns:sch1="http://www.springframework.org/spring-ws/samples/airline/schemas/types" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.springframework.org/spring-ws/samples/airline/definitions" targetNamespace="http://www.springframework.org/spring-ws/samples/airline/definitions">
2+
<wsdl:types>
3+
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.springframework.org/spring-ws/samples/airline/schemas/messages" xmlns:types="http://www.springframework.org/spring-ws/samples/airline/schemas/types" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.springframework.org/spring-ws/samples/airline/schemas/messages"><import namespace="http://www.springframework.org/spring-ws/samples/airline/schemas/types"/><element name="GetFlightsRequest"><complexType><all><element name="from" type="types:AirportCode"/><element name="to" type="types:AirportCode"/><element name="departureDate" type="date"/><element minOccurs="0" name="serviceClass" type="types:ServiceClass"/></all></complexType></element><element name="GetFlightsResponse"><complexType><sequence><element maxOccurs="unbounded" minOccurs="0" name="flight" type="types:Flight"/></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>
4+
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.springframework.org/spring-ws/samples/airline/schemas/types" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.springframework.org/spring-ws/samples/airline/schemas/types"><complexType name="Flight"><sequence><element name="number" type="tns:FlightNumber"/><element name="departureTime" type="dateTime"/><element name="from" type="tns:Airport"/><element name="arrivalTime" type="dateTime"/><element name="to" type="tns:Airport"/><element name="serviceClass" type="tns:ServiceClass"/></sequence></complexType><simpleType name="FlightNumber"><restriction base="string"><pattern value="[A-Z][A-Z][0-9][0-9][0-9][0-9]"/></restriction></simpleType><complexType name="Name"><sequence><element name="first" type="string"/><element name="last" type="string"/></sequence></complexType><simpleType name="FrequentFlyerUsername"><restriction base="string"/></simpleType><complexType name="Airport"><all><element name="code" type="tns:AirportCode"/><element name="name" type="string"/><element name="city" type="string"/></all></complexType><simpleType name="AirportCode"><restriction base="string"><pattern value="[A-Z][A-Z][A-Z]"/></restriction></simpleType><complexType name="Ticket"><all><element name="id" type="long"/><element name="issueDate" type="date"/><element name="passengers"><complexType><sequence><element maxOccurs="9" name="passenger" type="tns:Name"/></sequence></complexType></element><element name="flight" type="tns:Flight"/></all></complexType><simpleType name="ServiceClass"><restriction base="NCName"><enumeration value="economy"/><enumeration value="business"/><enumeration value="first"/></restriction></simpleType></schema>
5+
</wsdl:types>
6+
<wsdl:message name="BookFlightRequest">
7+
<wsdl:part element="sch0:BookFlightRequest" name="BookFlightRequest">
8+
</wsdl:part>
9+
</wsdl:message>
10+
<wsdl:message name="GetFlightsResponse">
11+
<wsdl:part element="sch0:GetFlightsResponse" name="GetFlightsResponse">
12+
</wsdl:part>
13+
</wsdl:message>
14+
<wsdl:message name="BookFlightResponse">
15+
<wsdl:part element="sch0:BookFlightResponse" name="BookFlightResponse">
16+
</wsdl:part>
17+
</wsdl:message>
18+
<wsdl:message name="GetFrequentFlyerMileageRequest">
19+
<wsdl:part element="sch0:GetFrequentFlyerMileageRequest" name="GetFrequentFlyerMileageRequest">
20+
</wsdl:part>
21+
</wsdl:message>
22+
<wsdl:message name="GetFlightsRequest">
23+
<wsdl:part element="sch0:GetFlightsRequest" name="GetFlightsRequest">
24+
</wsdl:part>
25+
</wsdl:message>
26+
<wsdl:message name="GetFrequentFlyerMileageResponse">
27+
<wsdl:part element="sch0:GetFrequentFlyerMileageResponse" name="GetFrequentFlyerMileageResponse">
28+
</wsdl:part>
29+
</wsdl:message>
30+
<wsdl:portType name="Airline">
31+
<wsdl:operation name="BookFlight">
32+
<wsdl:input message="tns:BookFlightRequest" name="BookFlightRequest">
33+
</wsdl:input>
34+
<wsdl:output message="tns:BookFlightResponse" name="BookFlightResponse">
35+
</wsdl:output>
36+
</wsdl:operation>
37+
<wsdl:operation name="GetFlights">
38+
<wsdl:input message="tns:GetFlightsRequest" name="GetFlightsRequest">
39+
</wsdl:input>
40+
<wsdl:output message="tns:GetFlightsResponse" name="GetFlightsResponse">
41+
</wsdl:output>
42+
</wsdl:operation>
43+
<wsdl:operation name="GetFrequentFlyerMileage">
44+
<wsdl:input message="tns:GetFrequentFlyerMileageRequest" name="GetFrequentFlyerMileageRequest">
45+
</wsdl:input>
46+
<wsdl:output message="tns:GetFrequentFlyerMileageResponse" name="GetFrequentFlyerMileageResponse">
47+
</wsdl:output>
48+
</wsdl:operation>
49+
</wsdl:portType>
50+
<wsdl:binding name="AirlineSoap11" type="tns:Airline">
51+
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
52+
<wsdl:operation name="BookFlight">
53+
<soap:operation soapAction=""/>
54+
<wsdl:input name="BookFlightRequest">
55+
<soap:body use="literal"/>
56+
</wsdl:input>
57+
<wsdl:output name="BookFlightResponse">
58+
<soap:body use="literal"/>
59+
</wsdl:output>
60+
</wsdl:operation>
61+
<wsdl:operation name="GetFlights">
62+
<soap:operation soapAction=""/>
63+
<wsdl:input name="GetFlightsRequest">
64+
<soap:body use="literal"/>
65+
</wsdl:input>
66+
<wsdl:output name="GetFlightsResponse">
67+
<soap:body use="literal"/>
68+
</wsdl:output>
69+
</wsdl:operation>
70+
<wsdl:operation name="GetFrequentFlyerMileage">
71+
<soap:operation soapAction=""/>
72+
<wsdl:input name="GetFrequentFlyerMileageRequest">
73+
<soap:body use="literal"/>
74+
</wsdl:input>
75+
<wsdl:output name="GetFrequentFlyerMileageResponse">
76+
<soap:body use="literal"/>
77+
</wsdl:output>
78+
</wsdl:operation>
79+
</wsdl:binding>
80+
<wsdl:service name="AirlineService">
81+
<wsdl:port binding="tns:AirlineSoap11" name="AirlineSoap11">
82+
<soap:address location="http://localhost:8080/airline-server/services"/>
83+
</wsdl:port>
84+
</wsdl:service>
85+
</wsdl:definitions>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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">
3+
<parent>
4+
<artifactId>airline-client</artifactId>
5+
<groupId>org.springframework.ws</groupId>
6+
<version>2.0.0-M1-SNAPSHOT</version>
7+
<relativePath>../pom.xml</relativePath>
8+
</parent>
9+
<modelVersion>4.0.0</modelVersion>
10+
<artifactId>airline-axis1-client</artifactId>
11+
<packaging>jar</packaging>
12+
<name>Spring WS Airline Sample - Axis 1 Client</name>
13+
<build>
14+
<plugins>
15+
<plugin>
16+
<groupId>org.codehaus.mojo</groupId>
17+
<artifactId>axistools-maven-plugin</artifactId>
18+
<configuration>
19+
<urls>
20+
<url>file://${project.basedir}/../airline.wsdl</url>
21+
</urls>
22+
<packageSpace>org.springframework.ws.samples.airline.client.axis1</packageSpace>
23+
</configuration>
24+
<executions>
25+
<execution>
26+
<goals>
27+
<goal>wsdl2java</goal>
28+
</goals>
29+
</execution>
30+
</executions>
31+
</plugin>
32+
<plugin>
33+
<groupId>org.codehaus.mojo</groupId>
34+
<artifactId>exec-maven-plugin</artifactId>
35+
<executions>
36+
<execution>
37+
<goals>
38+
<goal>java</goal>
39+
</goals>
40+
</execution>
41+
</executions>
42+
<configuration>
43+
<mainClass>org.springframework.ws.samples.airline.client.axis1.Main</mainClass>
44+
</configuration>
45+
</plugin>
46+
</plugins>
47+
</build>
48+
<dependencies>
49+
<dependency>
50+
<groupId>axis</groupId>
51+
<artifactId>axis</artifactId>
52+
<version>1.4</version>
53+
</dependency>
54+
<dependency>
55+
<groupId>axis</groupId>
56+
<artifactId>axis-jaxrpc</artifactId>
57+
<version>1.4</version>
58+
</dependency>
59+
<dependency>
60+
<groupId>commons-discovery</groupId>
61+
<artifactId>commons-discovery</artifactId>
62+
<version>0.4</version>
63+
</dependency>
64+
<dependency>
65+
<groupId>wsdl4j</groupId>
66+
<artifactId>wsdl4j</artifactId>
67+
</dependency>
68+
69+
70+
</dependencies>
71+
</project>

samples/airline/client/axis1/src/org/springframework/ws/samples/airline/client/axis1/Main.java renamed to samples/airline/client/axis1/src/main/java/org/springframework/ws/samples/airline/client/axis1/Main.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static void main(String[] args) throws ServiceException, RemoteException
4646
request.setDepartureDate(departureDate);
4747
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
4848
System.out.println("Requesting flights on " + dateFormat.format(departureDate));
49-
Flight[] flights = airline.getFlights(request);
49+
Flight[] flights = airline.getFlights(request).getFlight();
5050
System.out.println("Got " + flights.length + " results");
5151
if (flights.length > 0)
5252
{
@@ -66,8 +66,8 @@ private static void writeTicket(Ticket ticket) {
6666
System.out.println("Ticket " + ticket.getId());
6767
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
6868
System.out.println("Ticket issue date:\t" + dateFormat.format(ticket.getIssueDate()));
69-
for (int i = 0; i < ticket.getPassengers().length; i++) {
70-
writeName(ticket.getPassengers()[i]);
69+
for (int i = 0; i < ticket.getPassengers().getPassenger().length; i++) {
70+
writeName(ticket.getPassengers().getPassenger()[i]);
7171

7272
}
7373
writeFlight(ticket.getFlight());

samples/airline/client/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<name>Spring WS Airline Sample - Clients</name>
1313
<modules>
1414
<module>saaj</module>
15+
<module>axis1</module>
1516
</modules>
1617
</project>

0 commit comments

Comments
 (0)