Migrated to Gradle build

This commit migrates from a Maven-based build system to a Gradle-based
one. Changes include:

- Removed archetype & parent
- Renamed core, support, test, security and xml directories to
  spring-ws-core, spring-ws-test, spring-ws-security, spring-xml
  respectively.
- Moved samples to separate project
  (https://github.com/spring-projects/spring-ws-samples)
This commit is contained in:
Arjen Poutsma
2013-11-05 10:55:44 +01:00
committed by Arjen Poutsma
parent a8c1d2ad97
commit 843ca6d2ef
1362 changed files with 798 additions and 13079 deletions

3
.gitignore vendored
View File

@@ -9,3 +9,6 @@ atlassian-ide-plugin*.xml
.idea
/build
/spring-*/build
.gradle

78
README.md Normal file
View File

@@ -0,0 +1,78 @@
# Spring Web Services
Spring Web Services is a product of the Spring community focused on creating
document-driven Web services. Spring Web Services aims to facilitate
contract-first SOAP service development, allowing for the creation of flexible
web services using one of the many ways to manipulate XML payloads.
## Installation
Releases of Spring Web Services are available for download from Maven Central,
as well as our own repository, http://repo.springsource.org/release.
For Maven users:
<repository>
<id>repository.spring.release</id>
<name>Spring GA Repository</name>
<url>http://repo.spring.io/release</url>
</repository>
...
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
<version>2.1.4</version>
</dependency>
## Snapshots
Nightly snapshots of Spring Web Services are available for download from our
snapshot repository, http://repo.springsource.org/snapshot.
For Maven users:
<repository>
<id>repository.spring.snapshot</id>
<name>Spring Snapshot Repository</name>
<url>http://repo.spring.io/snapshot</url>
</repository>
...
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
<version>2.1.5.BUILD-SNAPSHOT</version>
</dependency>
## Building from Source
Spring Web Services uses a [Gradle](http://gradle.org)-based build system. In
the instructions below, [`./gradlew`](http://vimeo.com/34436402) is invoked
from the root of the source tree and serves as a cross-platform, self-contained
bootstrap mechanism for the build. The only prerequisites are
[Git](http://help.github.com/set-up-git-redirect) and JDK 1.7+.
### check out sources
`git clone git://github.com/spring-projects/spring-ws.git`
### compile and test, build all jars, distribution zips and docs
`./gradlew build`
### install all spring-\* jars into your local Maven cache
`./gradlew install`
... and discover more commands with `./gradlew tasks`. See also the [Gradle build and release FAQ](https://github.com/spring-projects/spring-framework/wiki/Gradle-build-and-release-FAQ).
## Documentation
See the current
[Javadoc](http://static.springsource.org/spring-ws/docs/current/javadoc-api)
and [reference
docs](http://static.springsource.org/spring-ws/docs/current/spring-ws-reference
).
## Issue Tracking
Spring Scala uses [JIRA](https://jira.springsource.org/browse/SWS) for issue tracking purposes
## License
Spring Web Services is [Apache 2.0 licensed](http://www.apache.org/licenses/LICENSE-2.0.html).

View File

@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>spring-ws-parent</artifactId>
<groupId>org.springframework.ws</groupId>
<version>2.1.5.RELEASE-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-ws-archetype</artifactId>
<packaging>jar</packaging>
<name>Spring WS Archetype</name>
<description>Spring Web Services Maven2 Archetype.</description>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/filtered-resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>

View File

@@ -1,35 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>\${groupId}</groupId>
<artifactId>\${artifactId}</artifactId>
<packaging>war</packaging>
<version>\${version}</version>
<name>\${artifactId} Spring-WS Application</name>
<url>http://www.springframework.org/spring-ws</url>
<build>
<finalName>\${artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
<version>@project.version@</version>
</dependency>
</dependencies>
</project>

View File

@@ -1,7 +0,0 @@
<archetype>
<id>spring-ws-archetype</id>
<resources>
<resource>src/main/webapp/WEB-INF/web.xml</resource>
<resource>src/main/webapp/WEB-INF/spring-ws-servlet.xml</resource>
</resources>
</archetype>

View File

@@ -1,11 +0,0 @@
<?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:sws="http://www.springframework.org/schema/web-services"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd">
<sws:annotation-driven/>
</beans>

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<display-name>Archetype Created Web Application</display-name>
<servlet>
<servlet-name>spring-ws</servlet-name>
<servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>spring-ws</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>

416
build.gradle Normal file
View File

@@ -0,0 +1,416 @@
buildscript {
repositories {
maven { url 'http://repo.springsource.org/plugins-release' }
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.4'
classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.2.7'
}
}
configure(allprojects) {
group = "org.springframework.ws"
ext.springVersion = "3.2.4.RELEASE"
ext.axiomVersion = "1.2.14"
apply plugin: "java"
apply plugin: "idea"
apply plugin: "eclipse"
apply plugin: "propdeps"
/* [compileJava, compileTestJava]*.options*.compilerArgs = [
"-Xlint:serial",
"-Xlint:varargs",
"-Xlint:cast",
"-Xlint:classfile",
"-Xlint:dep-ann",
"-Xlint:divzero",
"-Xlint:empty",
"-Xlint:finally",
"-Xlint:overrides",
"-Xlint:path",
"-Xlint:processing",
"-Xlint:static",
"-Xlint:try",
"-Xlint:-options", // intentionally disabled
"-Xlint:-fallthrough", // intentionally disabled
"-Xlint:-rawtypes", // TODO enable and fix warnings
"-Xlint:-deprecation", // TODO enable and fix warnings
"-Xlint:-unchecked" // TODO enable and fix warnings
]
*/
compileJava {
sourceCompatibility=1.5
targetCompatibility=1.5
}
sourceSets.test.resources.srcDirs = ['src/test/resources', 'src/test/java']
test {
systemProperty("java.awt.headless", "true")
systemProperty("testGroups", project.properties.get("testGroups"))
scanForTestClasses = false
include '**/*Test.*'
exclude '**/*Abstract*.*'
}
repositories {
maven { url 'http://repo.spring.io/libs-release' }
}
dependencies {
compile("commons-logging:commons-logging:1.1.1")
compile("org.springframework:spring-core:$springVersion")
testCompile("junit:junit:4.10")
testCompile("org.easymock:easymock:3.1")
testCompile("xmlunit:xmlunit:1.1")
testRuntime("org.codehaus.woodstox:woodstox-core-asl:4.1.3")
}
ext.javadocLinks = [
"http://docs.oracle.com/javase/7/docs/api/",
"http://docs.oracle.com/javaee/6/api/",
"http://jackson.codehaus.org/1.9.12/javadoc/",
"http://fasterxml.github.com/jackson-core/javadoc/2.2.2/",
] as String[]
}
configure(subprojects) { subproject ->
jar {
manifest.attributes["Created-By"] =
"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
manifest.attributes["Implementation-Title"] = subproject.name
manifest.attributes["Implementation-Version"] = subproject.version
from("${rootProject.projectDir}/src/dist") {
include "license.txt"
include "notice.txt"
into "META-INF"
expand(copyright: new Date().format("yyyy"), version: project.version)
}
}
javadoc {
description = "Generates project-level javadoc for use in -javadoc jar"
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = project.name
options.links(project.ext.javadocLinks)
// options.addStringOption('Xdoclint:none', '-quiet')
// suppress warnings due to cross-module @see and @link references;
// note that global 'api' task does display all warnings.
logging.captureStandardError LogLevel.INFO
logging.captureStandardOutput LogLevel.INFO // suppress "## warnings" message
}
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = "sources"
from sourceSets.main.allJava.srcDirs
include "**/*.java"
}
task javadocJar(type: Jar) {
classifier = "javadoc"
from javadoc
}
artifacts {
archives sourcesJar
archives javadocJar
}
}
project('spring-xml') {
description = "Spring XML"
dependencies {
// Spring
compile("org.springframework:spring-beans:$springVersion")
compile("org.springframework:spring-context:$springVersion")
//XML
optional("org.apache.ws.xmlschema:xmlschema-core:2.0.2")
optional("jaxen:jaxen:1.1.4")
}
}
project('spring-ws-core') {
description = 'Spring WS Core'
dependencies {
compile project(":spring-xml")
// Spring
compile("org.springframework:spring-aop:$springVersion")
compile("org.springframework:spring-beans:$springVersion")
compile("org.springframework:spring-oxm:$springVersion")
compile("org.springframework:spring-web:$springVersion")
compile("org.springframework:spring-webmvc:$springVersion")
testCompile("org.springframework:spring-test:$springVersion")
// XML
optional("org.jdom:jdom:2.0.1")
optional("dom4j:dom4j:1.6.1")
optional("xom:xom:1.2.5") {
exclude group: 'xml-apis', module: 'xml-apis'
exclude group: 'xerces', module: 'xercesImpl'
exclude group: 'xalan', module: 'xalan'
}
optional("org.apache.ws.xmlschema:xmlschema-core:2.0.2")
// SOAP
optional("org.apache.ws.commons.axiom:axiom-api:$axiomVersion")
optional("org.apache.ws.commons.axiom:axiom-impl:$axiomVersion") {
exclude group: 'org.codehaus.woodstox', module: 'wstx-asl'
}
// WSDL
optional("wsdl4j:wsdl4j:1.6.1")
// Transport
provided("javax.servlet:servlet-api:2.5")
optional("org.apache.httpcomponents:httpclient:4.2.5")
optional("commons-httpclient:commons-httpclient:3.1")
testCompile("org.mortbay.jetty:jetty:6.1.26")
testCompile("log4j:log4j:1.2.16")
testCompile("org.aspectj:aspectjrt:1.6.9")
testRuntime("org.aspectj:aspectjweaver:1.6.9")
}
}
project('spring-ws-support') {
description = 'Spring WS Support'
dependencies {
compile project(":spring-xml")
compile project(":spring-ws-core")
// Spring
compile("org.springframework:spring-beans:$springVersion")
compile("org.springframework:spring-jms:$springVersion")
testCompile("org.springframework:spring-test:$springVersion")
// Transport
provided("org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1")
provided("org.apache.geronimo.specs:geronimo-ejb_2.1_spec:1.1")
provided("javax.mail:mail:1.4.5")
optional("jivesoftware:smack:3.1.0")
testCompile("commons-httpclient:commons-httpclient:3.1")
testRuntime("org.apache.activemq:activemq-core:4.1.2")
testCompile("org.jvnet.mock-javamail:mock-javamail:1.6")
}
}
project('spring-ws-security') {
description = 'Spring WS Security'
dependencies {
compile project(":spring-xml")
compile project(":spring-ws-core")
// Spring
compile("org.springframework:spring-beans:$springVersion")
compile("org.springframework:spring-tx:$springVersion")
// Spring Security
compile("org.springframework.security:spring-security-core:3.1.0.RELEASE")
optional("net.sf.ehcache:ehcache:2.6.3") {
exclude group: 'net.sf.ehcache', module: 'ehcache-terracotta'
}
// WS-Security
optional("com.sun.xml.wss:xws-security:3.0") {
exclude group: 'javax.xml.crypto', module: 'xmldsig'
}
optional("org.apache.ws.security:wss4j:1.6.5")
// SOAP
provided("com.sun.xml.messaging.saaj:saaj-impl:1.3.19")
optional("org.apache.ws.commons.axiom:axiom-api:$axiomVersion")
optional("org.apache.ws.commons.axiom:axiom-impl:$axiomVersion") {
exclude group: 'org.codehaus.woodstox', module: 'wstx-asl'
}
}
}
project('spring-ws-test') {
description = 'Spring WS Test'
dependencies {
compile project(":spring-ws-core")
compile("xmlunit:xmlunit:1.1")
testCompile("org.springframework:spring-test:$springVersion")
}
}
configure(rootProject) {
description = 'Spring Web Services'
apply plugin: 'docbook-reference'
reference {
sourceDir = file('src/reference/docbook')
pdfFilename = 'spring-ws-reference.pdf'
}
// don't publish the default jar for the root project
configurations.archives.artifacts.clear()
task api(type: Javadoc) {
group = 'Documentation'
description = 'Generates aggregated Javadoc API documentation.'
title = "${rootProject.description} ${version} API"
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = rootProject.description
options.overview = 'src/api/overview.html'
options.splitIndex = true
options.links(
'http://docs.jboss.org/jbossas/javadoc/4.0.5/connector'
)
source subprojects.collect { project ->
project.sourceSets.main.allJava
}
destinationDir = new File(buildDir, "api")
classpath = files(subprojects.collect { project ->
project.sourceSets.main.compileClasspath
})
maxMemory = '1024m'
}
task docsZip(type: Zip) {
group = 'Distribution'
baseName = 'spring-ws'
classifier = 'docs'
description = "Builds -${classifier} archive containing api and reference " +
"for deployment at http://static.springframework.org/spring-framework/docs."
from('src/dist') {
include 'changelog.txt'
}
from (api) {
into 'api'
}
from (reference) {
into 'reference'
}
}
task schemaZip(type: Zip) {
group = 'Distribution'
baseName = 'spring-ws'
classifier = 'schema'
description = "Builds -${classifier} archive containing all " +
"XSDs for deployment at http://springframework.org/schema."
subprojects.each { subproject ->
def Properties schemas = new Properties();
subproject.sourceSets.main.resources.find {
it.path.endsWith('META-INF/spring.schemas')
}?.withInputStream { schemas.load(it) }
for (def key : schemas.keySet()) {
def shortName = key.replaceAll(/http.*schema\/(.*)\/.*/, '$1')
assert shortName != key
File xsdFile = subproject.sourceSets.main.resources.find {
it.path.endsWith(schemas.get(key))
}
assert xsdFile != null
into (shortName) {
from xsdFile.path
}
}
}
}
task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
group = 'Distribution'
baseName = 'spring-ws'
classifier = 'dist'
description = "Builds -${classifier} archive, containing all jars and docs, " +
"suitable for community download page."
ext.baseDir = "${baseName}-${project.version}";
from('src/dist') {
include 'readme.txt'
include 'license.txt'
include 'notice.txt'
into "${baseDir}"
expand(copyright: new Date().format('yyyy'), version: project.version)
}
from(zipTree(docsZip.archivePath)) {
into "${baseDir}/docs"
}
from(zipTree(schemaZip.archivePath)) {
into "${baseDir}/schema"
}
subprojects.each { subproject ->
into ("${baseDir}/libs") {
from subproject.jar
if (subproject.tasks.findByPath('sourcesJar')) {
from subproject.sourcesJar
}
if (subproject.tasks.findByPath('javadocJar')) {
from subproject.javadocJar
}
}
}
}
// Create an distribution that contains all dependencies (required and optional).
// Not published by default; only for use when building from source.
task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
group = 'Distribution'
baseName = 'spring-ws'
classifier = 'dist-with-deps'
description = "Builds -${classifier} archive, containing everything " +
"in the -${distZip.classifier} archive plus all runtime dependencies."
from zipTree(distZip.archivePath)
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(":${zipTask.name}")) {
def projectNames = rootProject.subprojects*.name
def artifacts = new HashSet()
subprojects.each { subproject ->
subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts.each { artifact ->
def dependency = artifact.moduleVersion.id
if (!projectNames.contains(dependency.name)) {
artifacts << artifact.file
}
}
}
zipTask.from(artifacts) {
into "${distZip.baseDir}/deps"
}
}
}
}
artifacts {
archives docsZip
archives schemaZip
archives distZip
}
task wrapper(type: Wrapper) {
description = 'Generates gradlew[.bat] scripts'
gradleVersion = '1.8'
}
}

View File

@@ -1,331 +0,0 @@
SPRING WEB SERVICES CHANGELOG
=============================
http://www.springframework.org/spring-ws
Changes in version 2.1.4.RELEASE
--------------------------------
** Bug
* [SWS-831] - BspCompliant is always set to true in Wss4jSecurityInterceptor
* [SWS-833] - All JMS headers ignored, if the are not contained in CONVERSION_TABLE or prefixed with SOAPJMS_
* [SWS-837] - Typo in embedded HTTP server documentation
* [SWS-840] - I can't set transformSchemaLocation attribute in MessageDispatcherServlet class through web.xml file
* [SWS-844] - WebServiceTemplate(Marshaller marshaller) constructor doesn't call initDefaultStrategies()
* [SWS-845] - checkForUtf8ByteOrderMark() will not detect BOM with some TLSv1 implementations
** Improvement
* [SWS-644] - ejb 2.1 dependency jar - change to freely available jar in M2 Central
* [SWS-835] - HttpComponentsMessageSender inintuitive constructor
* [SWS-838] - HttpComponentsMessageSender: Use the PoolingClientConnectionManager instead of the deprecated ThreadSafeClientConnManager
* [SWS-839] - Update documentation to use HttpComponentsMessageSender in favour of deprecated CommonsHttpMessageSender
** New Feature
* [SWS-832] - Add support for programmatically instantiating MessageDispatcherServlet
** Support
* [SWS-841] - NullPointerException on First invocation to Spring WS Service with Nonce
Changes in version 2.1.3.RELEASE
--------------------------------
** Bug
* [SWS-814] - EndPointIntercepters do not respect the (Autowired) properties provided in beans XML
* [SWS-815] - Error loading SAML properties file
* [SWS-816] - Missing encoding in dom4j element/document
* [SWS-817] - Camel Spring-WS and AbstractAddressingEndpointMapping
* [SWS-819] - SimpleNamespaceContext.removeBinding() does not clean up all references
* [SWS-822] - NoSuchMethodError after upgrading to AXIOM 1.2.14
* [SWS-824] - In v 2.1.0, dispatch method of MessageDispatcher does not call processEndpointException method if response schema validation fails
* [SWS-825] - Binary data get inlined when using JAXB for marshaling MTOM-enabled Axiom SOAP messages
* [SWS-828] - Setting bspCompliant = false has effect only for first request
** Improvement
* [SWS-813] - Cannot use jms MessagePostProcessor support with WebServiceMessageDrivenBean
* [SWS-821] - Not possible to create wrapped doc/literal wsdls with SuffixBasedPortTypesProvider
** Task
* [SWS-774] - Migrate to springsource github
Changes in version 2.1.2.RELEASE
--------------------------------
** Bug
* [SWS-797] - XsdSchemaHandlerAdapter does not transform schema locations
* [SWS-806] - @ symbol in the content-id is converted to %40. The receiving web server is not able to handle it
** Defect
* [SWS-804] - WebServiceMessageReceiverHandlerAdapter not easily overridable to produce SOAP faults
** Improvement
* [SWS-796] - Ability to specify SAML properties file in Wss4jInterceptor
* [SWS-798] - Ensure that only valid Java Identifiers are added to JMS headers
* [SWS-803] - WebServiceTemple -> add logRequest method analogue to existing logResponse
* [SWS-811] - When using annotation-driven register the SoapHeaderElementMethodArgumentResolver by default.
* [SWS-812] - Document @SoapHeader in reference guide
** New Feature
* [SWS-807] - Introduce FactoryBean for javax.net.ssl.KeyManagerFactory
* [SWS-808] - add support to pass in sslSocketFactory to org.springframework.ws.transport.http.HttpsUrlConnectionMessageSender
Changes in version 2.1.1.RELEASE
--------------------------------
** Bug
* [SWS-776] - Windows-specific error with relative XSD referencing
* [SWS-779] - PayloadValidatingInterceptor 's method is not getting triggered in the echo server sample program when the echo client program is executed.
* [SWS-782] - DefaultMethodEndpointAdapter.JDOM_CLASS_NAME must be updated to "org.jdom2.Element"
* [SWS-783] - SaxUtils leaks file handles, locks file on Windows
* [SWS-787] - MethodEndpoint.getBean is inconsistent with its API
* [SWS-789] - SoapEnvelopeLoggingInterceptor won't log
** Improvement
* [SWS-784] - Add URLPathEndpointMapping Feature
* [SWS-785] - MTOM sample should not use deprecated api
** New Feature
* [SWS-786] - SOAP envelope Matcher / MessageCreator
* [SWS-791] - Transform schemaLocation in WsdlDefinitionHandlerAdapter
Changes in version 2.1.0.RELEASE
--------------------------------
** Bug
* [SWS-777] - SoapFaultMappingExceptionResolver not handling exception
Changes in version 2.1.0.RC1
----------------------------
** Bug
* [SWS-757] - Airline Sample Maven Build Error
** Improvement
* [SWS-711] - Upgrade to wss4j 1.6
* [SWS-758] - Upgrade XmlSchemaCollection
* [SWS-771] - Upgrade template.mf
* [SWS-772] - <sws:annotation-driven/> should register a SoapFaultAnnotationExceptionResolver
** New Feature
* [SWS-563] - Provide support for Apache HttpClient 4.0
Changes in version 2.0.5.RELEASE
--------------------------------
** Bug
* [SWS-754] - EndpointInterceptor.afterCompletion is not always invoked
* [SWS-759] - FAQ about Mac OS X test failures needs updating
* [SWS-763] - Namespace problems after upgrading to Axiom 1.2.13
** Defect
* [SWS-764] - SoapEnvelopeLoggingInterceptor logging only partial request/response when Axis SAAJ API is used along with Xalan 2.7.1 and log4j 1.2.16 (using %m option)
* [SWS-766] - Broken link in SWS 2.0.4 - org.springframework.ws.soap.security.xwss
* [SWS-769] - Error in org.springframework.ws.context's content
* [SWS-770] - In documentation, JMS server configuration doesn't work
** Improvement
* [SWS-760] - Please specify URL and license in pom.xml
* [SWS-761] - Add method to set digest algorithm for signature (WSS4J)
* [SWS-762] - Allow multiple prefixes and suffixes in DefaultWsdl11Definition
* [SWS-768] - Make JAXP13ValidatorFactory smarter
Changes in version 2.0.4.RELEASE
--------------------------------
** Bug
* [SWS-647] - PayloadValidatingInterceptor throws IllegalArgumentException when passed a schema collection
* [SWS-742] - JMSCorrelationID together with Oracle AQ
* [SWS-748] - Not well formed xml causes server 500 error
* [SWS-750] - SaajSoapMessageFactory's checkForUtf8ByteOrderMark is corrupting input stream
* [SWS-752] - Provider com.sun.xml.stream.ZephyrParserFactory not found using annotation-driven
** Improvement
* [SWS-491] - Digital signing java 6
* [SWS-745] - Convenience constructor for SimpleUsernamePasswordCallbackHandler
* [SWS-749] - org.springframework.xml.sax.SaxUtils swallows exceptions
Changes in version 2.0.3.RELEASE
--------------------------------
** Bug
* [SWS-687] - Attachment content id is resetted by spring web service
* [SWS-702] - sws:annotation-driven does not pick up @Endpoint annotations on classes that are JDK proxies
* [SWS-709] - JavaDoc for WebServiceTemplate#setFaultMessageResolver has wrong default class
* [SWS-713] - Order of interceptor calls is dependent on the way the interceptors are included
* [SWS-718] - Reloading the spring context does not refresh the MessageDispatcherServlet
* [SWS-720] - samples build failure
* [SWS-721] - EndpointExceptionResolver mentions SOAP but this interface is not necessarily SOAP releated
* [SWS-724] - DefaultConcretePartProvider is not allowing a blank suffix, due to improper assertion
* [SWS-726] - CryptoFactoryBean keystore location can't resolve ClassPathResource where resource is located in a jar
* [SWS-727] - building a webapp targetting Java 1.5 environment on JDK5 and JDK6 pulled in different dependencies for spring-ws-core 2.0.2
* [SWS-732] - OSGi manifest version range for javax.servlet package import too restrictive
* [SWS-733] - Typo in marshalSendAndReceive javadoc
* [SWS-734] - Project can not be built with Maven 3, missing org.springframework.build.aws.maven extension dependency
* [SWS-737] - EndpointInterceptorAdapter removes "throws Exception" from handleFault() method defined by EndpointInterceptor
* [SWS-739] - Spring WS Core manifest prevents usage of javax.servlet version 3.0.0
** Improvement
* [SWS-697] - Support Maven 3 Remove legacy xws-security
* [SWS-710] - Make it possible to retrieve SoapHeaderElement from SoapHeader by QName
* [SWS-714] - MockWebServiceClient.sendRequest swallows StackTrace of exceptions thrown during request processing
* [SWS-716] - PayloadTransformingInterceptor.afterPropertiesSet() and TransformerFactory.newInstance()
* [SWS-717] - Impossible to add custom error handling during JAXB marshalling/unmarshalling.
* [SWS-725] - Add a constructor/setter to WebServiceTemplate which takes a Marshaller and assigns it as both Marshaller and Unmarshaller
* [SWS-735] - JmsMessageReceiverConnection: use of correlationId on request should be configurable
** Refactoring
* [SWS-723] - Wss4jSecurityInterceptor design
** Task
* [SWS-715] - Upgrade Spring Security to 3.0.6
* [SWS-728] - OXM chapter not linked from the index page
Changes in version 2.0.2.RELEASE
--------------------------------
** Bug
* [SWS-702] - sws:annotation-driven does not pick up @Endpoint annotations on classes that are JDK proxies
* [SWS-705] - OSGi import of org.springframework.security.authentication seems to be the wrong version
* [SWS-708] - PayloadValidatingInterceptor errors not clearing SecurityContextHolder
** Improvement
* [SWS-706] - Jaxp13XPathTemplate should support StreamSources with only a systemId if it's a valid URL
** New Feature
* [SWS-662] - Support for UriEndpointMapping in server-side test
Changes in version 2.0.1.RELEASE
--------------------------------
** Bug
* [SWS-242] - Allow for custom ErrorHandler in PayloadValidatingInterceptor
* [SWS-681] - Manifest files in 2.0.0 release are incorrect
* [SWS-682] - ExceptionResolver order is reversed
* [SWS-691] - Annotation-driven tag does not support ws-addressing @Action
* [SWS-698] - EndpointExceptionResolver is not registered automatically when used together with <sws:annotation-driven/> tag
* [SWS-699] - XomPayloadMethodProcessor is not added methodReturnValueHandlers in DefaultMethodEndpointAdapter
** Improvement
* [SWS-551] - Support @Secured for @PayloadRoot methods
* [SWS-676] - SOAP Envelope prefix
* [SWS-683] - Improve the Maven archetype
* [SWS-684] - Allow for bean references inside the <interceptors> namespace element
* [SWS-686] - Make the locationURI in dynamic wsdls mandatory
* [SWS-694] - Print SOAP message if validation fails
** Task
* [SWS-685] - Fix broken references in the reference doc
Changes in version 2.0.0.RELEASE
--------------------------------
** Bug
* [SWS-585] - POMs of Spring-WS artifacts at maven central repo wrongfuly contain references to external repositories
* [SWS-675] - XwssSecurityInterceptor in combination with <sws:interceptors>
* [SWS-677] - /META-INF/spring.schema
** Improvement
* [SWS-254] - Add an EndpointAdapter that adapts to a MethodEndpoint for a methos with one Source param containing the payload
* [SWS-557] - Make XPathParamAnnotationMethodEndpointAdapter more extendable
* [SWS-558] - Use custom data types for @XPathParam annotations
* [SWS-673] - Remove final keyword from AbstractAnnotationMethodEndpointMapping initApplicationContext() method
** New Feature
* [SWS-263] - Provide xml based Mock for Web Services
Changes in version 2.0 Release Candidate 2
------------------------------------------
** Sub-task
* [SWS-668] - sws:annotation-driven
* [SWS-669] - sws:static-wsdl and sws:dynamic-wsdl
* [SWS-670] - sws:interceptors
** Bug
* [SWS-656] - ResponseMatcher.payload(Resource payload) should be static
* [SWS-664] - Tutorial requires transformWsdlLocations true
** Improvement
* [SWS-672] - Allow MarshallingPayloadMethodProcessor to have a null marshaller or unmarshaller
** New Feature
* [SWS-667] - Improve SWS namespace
** Task
* [SWS-652] - Document full streaming WebServiceMessage
* [SWS-653] - Make sure samples are included in release
* [SWS-666] - Update tutorial
Changes in version 2.0 Release Candidate 1
------------------------------------------
** Sub-task
* [SWS-631] - Create Client-Side testing framework
* [SWS-632] - Create Server-Side testing framework
* [SWS-651] - Add documentation for testing framework
** Bug
* [SWS-640] - evaluateAsBoolean returns true for node with text content "false"
** Improvement
* [SWS-544] - Add test framework for Spring WS
* [SWS-635] - handleUsernameTokenUnknown() should attach root cause
* [SWS-641] - Make sentMessageTracingLogger independent from receivedMessageTracingLogger
* [SWS-648] - Document Spring-WS Security exception handling
* [SWS-650] - AxiomSoapMessageFactory does not provide way to set properties on XMLInputFactory
** New Feature
* [SWS-352] - Full streaming WebServiceMessage/SoapMessage
* [SWS-642] - Support resolving SOAP header elements in @Endpoint method parameters
* [SWS-643] - Create TransformerHelper class
** Task
* [SWS-639] - Deprecate redundant XML classes
Changes in version 2.0 Milestone 3
----------------------------------
** Sub-task
* [SWS-631] - Create Client-Side testing framework
** Improvement
* [SWS-610] - Incompatibility with WS-I requirement R2750
** Task
* [SWS-620] - Add the Spring-OXM jar to the "with dependencies" distribution
* [SWS-624] - Documentation- explain that WSDL generation should better not be used in production
Changes in version 2.0 Milestone 2
----------------------------------
** Bug
* [SWS-613] - Jaxp13XPathTemplate uses thread-unsafe XPathFactory as field
** Improvement
* [SWS-538] - Add support for XWSS 3.1
** New Feature
* [SWS-193] - XwsSecurityInterceptor : funtionality for skipping the validate of a SOAP message when there are no WSSE headers in SOAP envelope.
* [SWS-349] - Support @PayloadRoot annotation on methods with DOM, JDOM, DOM4J and XOM type method signatures
* [SWS-351] - Arbitrary parameter injection for @Endpoints
* [SWS-428] - XMPP support
* [SWS-540] - Adding XML declaration to a response
** Task
* [SWS-559] - Upgrade Spring Security to 3.0.2
* [SWS-603] - Drop OXM chapter from ref docs
* [SWS-604] - Upgrade XSD schemas
Changes in version 2.0 Milestone 1
------------------------
** Bug
* [SWS-501] - Maven dependency for oxm 1.5.5.A non-existent version of Spring
** Refactoring
* [SWS-567] - Refactor to use OXM from Spring 3
** Task
* [SWS-451] - Update spring-ws Maven POM to use correct Spring artifactId values
* [SWS-597] - Merge core and core-tiger modules
* [SWS-598] - Drop OXM modules in favor of Spring 3.0
* [SWS-599] - Change API to use Java 5+

View File

@@ -1,174 +0,0 @@
<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">
<parent>
<artifactId>spring-ws-parent</artifactId>
<groupId>org.springframework.ws</groupId>
<version>2.1.5.RELEASE-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-ws-core</artifactId>
<packaging>jar</packaging>
<name>Spring WS Core</name>
<description>Spring Web Services Core package.</description>
<profiles>
<profile>
<id>jdk15</id>
<activation>
<jdk>!1.6</jdk>
</activation>
<dependencies>
<dependency>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>saaj-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.messaging.saaj</groupId>
<artifactId>saaj-impl</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>com.springsource.bundlor</groupId>
<artifactId>com.springsource.bundlor.maven</artifactId>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Spring-WS dependencies -->
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-xml</artifactId>
</dependency>
<!-- Spring dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
<!-- XML handling dependencies -->
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>xom</groupId>
<artifactId>xom</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-asl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.ws.xmlschema</groupId>
<artifactId>xmlschema-core</artifactId>
<scope>test</scope>
</dependency>
<!-- SOAP dependencies -->
<dependency>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-api</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-impl</artifactId>
<optional>true</optional>
</dependency>
<!-- WSDL dependencies -->
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
</dependency>
<!-- Java EE dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</dependency>
<!-- Transport dependencies -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<scope>test</scope>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.6.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.5.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>2.1_3</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

1
gradle.properties Normal file
View File

@@ -0,0 +1 @@
version=2.1.5.BUILD-SNAPSHOT

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,6 @@
#Thu Nov 07 12:02:13 CET 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip

164
gradlew vendored Executable file
View File

@@ -0,0 +1,164 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

90
gradlew.bat vendored Normal file
View File

@@ -0,0 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@@ -1,12 +0,0 @@
Dear Spring community,
I'm pleased to announce that Spring Web Services 2.1.4.RELEASE has been released!
This is the latest GA release in the 2.1 release cycle. It mainly
consists of bug fixes.
Please see the changelog for more details.
For more information, refer to
http://static.springframework.org/spring-ws/sites/2.0

View File

@@ -1,21 +0,0 @@
======================================================================
== NOTICE file corresponding to section 4 d of the Apache License, ==
== Version 2.0, in this case for the Spring Framework distribution. ==
======================================================================
This product includes software developed by
the Apache Software Foundation (http://www.apache.org).
The end-user documentation included with a redistribution, if any,
must include the following acknowledgement:
"This product includes software developed by the Spring Framework
Project (http://www.springframework.org)."
Alternatively, this acknowledgement may appear in the software itself,
if and wherever such third-party acknowledgements normally appear.
The names "Spring", "Spring Framework", and "Spring Web Services" must
not be used to endorse or promote products derived from this software
without prior written permission. For written permission, please contact
enquiries@springsource.com.

View File

@@ -1,762 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-parent</artifactId>
<packaging>pom</packaging>
<version>2.1.5.RELEASE-SNAPSHOT</version>
<name>Spring Web Services - Parent</name>
<url>http://static.springframework.org/spring-ws/site/index.html</url>
<organization>
<name>The Spring Web Services Framework</name>
<url>http://www.springframework.org/spring-ws</url>
</organization>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<distributionManagement>
<downloadUrl>http://static.springframework.org/spring-ws/site/downloads/releases.html</downloadUrl>
<!--
<repository>
<id>spring-milestone</id>
<name>Spring Milestone Repository</name>
<url>s3://maven.springframework.org/milestone</url>
</repository>
-->
<repository>
<id>spring-release</id>
<name>Spring Release Repository</name>
<url>s3://maven.springframework.org/release</url>
</repository>
<snapshotRepository>
<id>spring-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>s3://maven.springframework.org/snapshot</url>
</snapshotRepository>
<site>
<id>static.springframework.org</id>
<url>scp://static.springframework.org/var/www/domains/springframework.org/static/htdocs/spring-ws/sites/2.0</url>
</site>
</distributionManagement>
<scm>
<connection>scm:svn:https://src.springframework.org/svn/spring-ws/trunk</connection>
<developerConnection>scm:svn:https://src.springframework.org/svn/spring-ws/trunk</developerConnection>
<url>https://fisheye.springframework.org/browse/spring-ws/trunk</url>
</scm>
<properties>
<osgi.version>2.1.4.RELEASE</osgi.version>
<osgi.range>"${osgi.version:[=.=.=, =.=.+1)}"</osgi.range>
<spring.framework.version>3.2.4.RELEASE</spring.framework.version>
<spring.framework.osgi.range>"[3.2.4, 4.0.0)"</spring.framework.osgi.range>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<pluginRepositories>
<pluginRepository>
<id>spring-release</id>
<name>Spring Release Repository</name>
<url>http://maven.springframework.org/release</url>
</pluginRepository>
<pluginRepository>
<id>com.springsource.repository.bundles.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/release/</url>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>spring-release</id>
<name>Spring Release Repository</name>
<url>http://maven.springframework.org/release</url>
</repository>
</repositories>
<build>
<extensions>
<extension>
<groupId>org.springframework.build.aws</groupId>
<artifactId>org.springframework.build.aws.maven</artifactId>
<version>3.1.0.RELEASE</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.3</version>
<configuration>
<forkMode>once</forkMode>
<childDelegation>false</childDelegation>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.1</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<escapeString>\</escapeString>
</configuration>
</plugin>
<plugin>
<groupId>com.springsource.bundlor</groupId>
<artifactId>com.springsource.bundlor.maven</artifactId>
<version>1.0.0.RELEASE</version>
<executions>
<execution>
<id>bundlor</id>
<goals>
<goal>bundlor</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.3</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.10</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>axistools-maven-plugin</artifactId>
<version>1.3</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xmlbeans-maven-plugin</artifactId>
<version>2.3.3</version>
</plugin>
<plugin>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId>
<version>2.0.13</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!-- Building -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>1.0-beta-7</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.1</version>
<configuration>
<aggregate>true</aggregate>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<aggregate>true</aggregate>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.6.1</version>
<configuration>
<quiet>true</quiet>
</configuration>
<reportSets>
<reportSet>
<reports>
<report>javadoc</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
<dependencyManagement>
<dependencies>
<!-- Spring-WS dependencies -->
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-xml</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-support</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-security</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-test</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Spring dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.framework.version}</version>
<scope>test</scope>
</dependency>
<!-- XML handling dependencies -->
<dependency>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
<version>1.0-2</version>
</dependency>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1.3</version>
<exclusions>
<exclusion>
<groupId>maven-plugins</groupId>
<artifactId>maven-cobertura-plugin</artifactId>
</exclusion>
<exclusion>
<groupId>maven-plugins</groupId>
<artifactId>maven-findbugs-plugin</artifactId>
</exclusion>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
<exclusion>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</exclusion>
<exclusion>
<groupId>jdom</groupId>
<artifactId>jdom</artifactId>
</exclusion>
<exclusion>
<groupId>xom</groupId>
<artifactId>xom</artifactId>
</exclusion>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xmlParserAPIs</artifactId>
</exclusion>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-asl</artifactId>
<version>4.1.3</version>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>xom</groupId>
<artifactId>xom</artifactId>
<version>1.2.5</version>
<exclusions>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xmlParserAPIs</artifactId>
</exclusion>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
<exclusion>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
</exclusion>
<exclusion>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>xpp3</groupId>
<artifactId>xpp3</artifactId>
<version>1.1.3.4.O</version>
</dependency>
<dependency>
<groupId>org.apache.ws.xmlschema</groupId>
<artifactId>xmlschema-core</artifactId>
<version>2.0.2</version>
</dependency>
<!-- O/X Mapping dependencies -->
<!-- XMLBeans -->
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.4.0</version>
</dependency>
<!-- XStream -->
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.2</version>
<exclusions>
<exclusion>
<groupId>stax</groupId>
<artifactId>stax</artifactId>
</exclusion>
<exclusion>
<groupId>stax</groupId>
<artifactId>stax-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- SOAP dependencies -->
<dependency>
<groupId>com.sun.xml.messaging.saaj</groupId>
<artifactId>saaj-impl</artifactId>
<version>1.3.19</version>
<exclusions>
<exclusion>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-api</artifactId>
<version>1.2.14</version>
<exclusions>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-activation_1.1_spec</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-javamail_1.4_spec</artifactId>
</exclusion>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-stax-api_1.0_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-impl</artifactId>
<version>1.2.14</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-activation_1.1_spec</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-javamail_1.4_spec</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-stax-api_1.0_spec</artifactId>
</exclusion>
<exclusion>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
</exclusion>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>wstx-asl</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- WSDL dependencies -->
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
<version>1.6.1</version>
</dependency>
<!-- WS-Security dependencies -->
<dependency>
<groupId>com.sun.xml.wsit</groupId>
<artifactId>xws-security</artifactId>
<!-- Version 1.3.1 is actually XWSS 3.0 -->
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.wsit</groupId>
<artifactId>wsit-rt</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.apache.ws.security</groupId>
<artifactId>wss4j</artifactId>
<version>1.6.5</version>
<exclusions>
<exclusion>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
</exclusion>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Spring Security -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>3.1.0.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-support</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>3.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.1.0.RELEASE</version>
</dependency>
<!-- X.509 dependencies -->
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>2.5.2</version>
<optional>true</optional>
</dependency>
<!-- JEE dependencies -->
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>saaj-api</artifactId>
<version>1.3.4</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.5</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_1.1_spec</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-ejb_2.1_spec</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0.2</version>
<scope>provided</scope>
</dependency>
<!-- Transport dependencies -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.2.5</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.26</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
<version>4.1.1</version>
<exclusions>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_1.1_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>jivesoftware</groupId>
<artifactId>smack</artifactId>
<version>3.1.0</version>
</dependency>
<!-- Logging dependencies -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>logkit</groupId>
<artifactId>logkit</artifactId>
</exclusion>
<exclusion>
<groupId>avalon-framework</groupId>
<artifactId>avalon-framework</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<scope>test</scope>
<version>3.1</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

366
pom.xml
View File

@@ -1,366 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws</artifactId>
<packaging>pom</packaging>
<version>2.1.5.RELEASE-SNAPSHOT</version>
<name>Spring Web Services</name>
<description>
Spring Web Services is a product of the Spring community focused on creating document-driven Web services. It
aims to facilitate contract-first SOAP service development, allowing for the creation of flexible web services
using one of the many ways to manipulate XML payloads.
</description>
<url>http://static.springframework.org/spring-ws/site/index.html</url>
<issueManagement>
<system>JIRA</system>
<url>http://jira.springframework.org/browse/SWS</url>
</issueManagement>
<ciManagement>
<system>bamboo</system>
<url>http://build.springframework.org/browse/SWS</url>
</ciManagement>
<inceptionYear>2005</inceptionYear>
<developers>
<developer>
<id>apoutsma</id>
<name>Arjen Poutsma</name>
<email>apoutsma@vmware.com</email>
<organization>SpringSource - a division of VMware</organization>
<organizationUrl>http://www.springsource.com</organizationUrl>
<roles>
<role>Project Admin</role>
<role>Developer</role>
</roles>
<timezone>+1</timezone>
</developer>
<developer>
<id>tareqa</id>
<name>Tareq Abed Rabbo</name>
<email>tareq.abedrabbo@gmail.com</email>
<roles>
<role>Developer</role>
</roles>
<timezone>+1</timezone>
</developer>
</developers>
<contributors>
<contributor>
<name>Ingo Siebert</name>
</contributor>
<contributor>
<name>Ben Ethridge</name>
</contributor>
<contributor>
<name>Kristoffer Moum</name>
</contributor>
<contributor>
<name>Rick Evans</name>
</contributor>
<contributor>
<name>Giovanni Cuccu</name>
</contributor>
<contributor>
<name>Lukas Krecan</name>
<url>http://blog.krecan.net</url>
</contributor>
</contributors>
<organization>
<name>The Spring Web Services Framework</name>
<url>http://www.springframework.org/spring-ws</url>
</organization>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<distributionManagement>
<downloadUrl>http://www.springsource.com/download/community?project=Spring%20Web%20Services</downloadUrl>
<!--
<repository>
<id>spring-milestone</id>
<name>Spring Milestone Repository</name>
<url>s3://maven.springframework.org/milestone</url>
</repository>
-->
<repository>
<id>spring-release</id>
<name>Spring Release Repository</name>
<url>s3://maven.springframework.org/release</url>
</repository>
<snapshotRepository>
<id>spring-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>s3://maven.springframework.org/snapshot</url>
</snapshotRepository>
<site>
<id>static.springframework.org</id>
<url>scp://static.springframework.org/var/www/domains/springframework.org/static/htdocs/spring-ws/sites/2.0</url>
</site>
</distributionManagement>
<scm>
<connection>scm:git:https://github.com/SpringSource/spring-ws.git</connection>
<developerConnection>scm:git:https://github.com/SpringSource/spring-ws.git</developerConnection>
<url>https://fisheye.springframework.org/browse/spring-ws/trunk</url>
</scm>
<properties>
<spring.framework.version>3.2.4.RELEASE</spring.framework.version>
</properties>
<modules>
<module>parent</module>
<module>xml</module>
<module>core</module>
<module>support</module>
<module>security</module>
<module>test</module>
<module>archetype</module>
</modules>
<profiles>
<profile>
<id>samples</id>
<modules>
<module>samples</module>
</modules>
</profile>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<inherited>false</inherited>
<executions>
<execution>
<id>full</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/assembly/full.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<pluginRepositories>
<pluginRepository>
<id>spring-release</id>
<name>Spring Release Repository</name>
<url>http://maven.springframework.org/release</url>
</pluginRepository>
</pluginRepositories>
<build>
<extensions>
<extension>
<groupId>org.springframework.build.aws</groupId>
<artifactId>org.springframework.build.aws.maven</artifactId>
<version>3.1.0.RELEASE</version>
</extension>
</extensions>
<plugins>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.1</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>1.0-beta-7</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<inherited>false</inherited>
<executions>
<execution>
<id>all-jar</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Spring-WS-Version>${project.version}</Spring-WS-Version>
</manifestEntries>
</archive>
<descriptors>
<descriptor>src/assembly/all.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>sources</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Spring-WS-Version>${project.version}</Spring-WS-Version>
</manifestEntries>
</archive>
<descriptors>
<descriptor>src/assembly/sources.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>minimal-zip</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/assembly/minimal.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId>
<version>2.0.13</version>
<executions>
<execution>
<goals>
<goal>generate-html</goal>
<goal>generate-pdf</goal>
</goals>
<phase>pre-site</phase>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.docbook</groupId>
<artifactId>docbook-xml</artifactId>
<version>4.4</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<configuration>
<includes>index.xml</includes>
<chunkedOutput>true</chunkedOutput>
<htmlStylesheet>css/html.css</htmlStylesheet>
<highlightSource>1</highlightSource>
<xincludeSupported>true</xincludeSupported>
<htmlCustomization>src/docbkx/resources/xsl/html_chunk.xsl</htmlCustomization>
<foCustomization>src/docbkx/resources/xsl/fopdf.xsl</foCustomization>
<postProcess>
<copy todir="target/site/reference">
<fileset dir="target/docbkx">
<include name="**/*.html" />
<include name="**/*.pdf" />
</fileset>
</copy>
<copy todir="target/site/reference/html">
<fileset dir="src/docbkx/resources">
<include name="**/*.css" />
<include name="**/*.png" />
<include name="**/*.gif" />
<include name="**/*.jpg" />
</fileset>
</copy>
<move file="target/site/reference/pdf/index.pdf" tofile="target/site/reference/pdf/spring-ws-reference.pdf" failonerror="false" />
<move todir="target/site/reference/html" failonerror="false">
<fileset dir="target/site/reference/html/index" />
</move>
</postProcess>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.1</version>
<configuration>
<aggregate>true</aggregate>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<aggregate>true</aggregate>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.7</version>
<configuration>
<breakiterator>true</breakiterator>
<header>Spring Web Services Framework</header>
<source>1.5</source>
<quiet>true</quiet>
<stylesheetfile>${basedir}/src/main/javadoc/javadoc.css</stylesheetfile>
<overview>${basedir}/src/main/javadoc/overview.html</overview>
<groups>
<group>
<title>Spring-WS</title>
<packages>org.springframework.ws*</packages>
</group>
<group>
<title>Spring-XML</title>
<packages>org.springframework.xml*</packages>
</group>
</groups>
<javadocDirectory>${basedir}/src/main/javadoc</javadocDirectory>
<excludePackageNames>org.springframework.ws.samples</excludePackageNames>
<links>
<link>http://java.sun.com/javase/6/docs/api/</link>
<link>http://java.sun.com/javaee/5/docs/api/</link>
<link>http://java.sun.com/webservices/docs/2.0/api</link>
<link>http://java.sun.com/webservices/docs/2.0/xws-security/api/</link>
<link>http://static.springframework.org/spring/docs/2.5.x/api</link>
<link>http://jakarta.apache.org/commons/logging/apidocs/</link>
<link>http://xmlbeans.apache.org/docs/2.0.0/reference</link>
<link>http://jibx.sourceforge.net/api</link>
<link>http://ws.apache.org/commons/axiom/apidocs/</link>
<link>http://dom4j.org/apidocs/</link>
<link>http://jdom.org/docs/apidocs/</link>
<link>http://www.xom.nu/apidocs/</link>
<link>http://acegisecurity.org/acegi-security/apidocs/</link>
<link>http://www.extreme.indiana.edu/apis/wsdl4j/</link>
<link>http://jakarta.apache.org/commons/httpclient/apidocs/</link>
<link>http://ws.apache.org/wss4j/apidocs/</link>
<link>http://java.sun.com/javase/6/docs/jre/api/net/httpserver/spec/</link>
<link>http://ws.apache.org/commons/XmlSchema/apidocs/</link>
</links>
</configuration>
<reportSets>
<reportSet>
<reports>
<report>aggregate</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
</project>

View File

@@ -1,92 +0,0 @@
SPRING WEB SERVICES 2.1.4.RELEASE (August 2013)
-------------------------------
http://www.springframework.org/spring-ws
http://forum.springframework.org/forumdisplay.php?f=39
1. INTRODUCTION
Spring Web Services (Spring-WS) is a product of the Spring community focused on creating document-driven Web services.
Spring-WS aims to facilitate contract-first SOAP service development, allowing for the creation of flexible web services
using one of the many ways to manipulate XML payloads.
2. RELEASE INFO
Spring-WS requires J2SE 1.5 or higher and J2EE 1.4 or higher. J2SE 1.6 is required for building.
Release contents:
"." contains Spring-WS distribution units (jars and source zip archives), readme, and copyright
"dist" contains the Spring-WS distribution
"dist/modules" contains the Spring-WS modules
The -with-dependencies distribution contains the following additional content:
"dist/module-sources" contains the Spring-WS modules
"docs" contains the Spring-WS reference manual and API Javadocs
"samples" contains buildable Spring-WS sample application sources
"lib" contains the Spring-WS dependencies
See the readme.txt within the above directories for additional information.
Spring-WS is released under the terms of the Apache Software License (see license.txt).
3. DISTRIBUTION JAR FILES
The following distinct jar files are included in the distribution. This list specifies the respective contents and
third-party dependencies. Libraries in [brackets] are optional, i.e. just necessary for certain functionality. For an
exact list of Spring-WS project dependencies see the respective Maven2 pom.xml files.
* spring-ws-core-2.1.4.RELEASE.jar
- Contents: The Spring-WS Core
- Dependencies: Commons Logging, spring-beans, spring-core, spring-context, spring-oxm
[Log4J, spring-web, spring-webmvc, SAAJ, JDOM, StAX, Servlet API, JAF, Axiom, DOM4J, XOM, WSDL4J]
* spring-ws-support-2.1.4.RELEASE.jar
- Contents: The Spring-WS Support
- Dependencies: Commons Logging, spring-beans, spring-core, spring-context, spring-core
[JMS, JavaMail]
* spring-ws-security-2.1.4.RELEASE.jar
- Contents: Spring-WS Security integration
- Dependencies: Commons Logging, spring-beans, spring-core, spring-context, spring-ws-core
[Log4J, xmlsdig, xmlsec, XWS-security, Acegi, WSS4J]
* spring-ws-test-2.1.4.RELEASE.jar
- Contents: Spring-WS Testing framework
- Dependencies: JUnit, XMLUnit
* spring-xml-2.1.4.RELEASE.jar
- Contents: Spring XML utility framework
- Dependencies: Commons Logging, spring-beans, spring-core
[StAX, Xalan, Jaxen]
* spring-ws-2.1.4.RELEASE-all.jar
- Contents: Convenient al-in-one jar containing all of the jars described above
4. WHERE TO START
This distribution contains documentation and two sample applications illustrating the features of Spring-WS.
A great way to get started is to review and run the sample applications, supplementing with reference manual
material as needed. You will require Maven 2, which can be downloaded from http://maven.apache.org/, for building
Spring-WS. To build deployable .war files for all samples, simply access the "samples" directory and
execute the "mvn package" command, or run "mvn jetty:run" to run the samples directly in a Jetty 6 Web container.
More information on deploying Spring-WS sample applications can be found at:
samples/readme.txt
5. ADDITIONAL RESOURCES
The Spring-WS homepage is located at:
http://www.springframework.org/spring-ws
Spring-WS support forums are located at:
http://forum.springframework.org/forumdisplay.php?f=39
The Spring Framework portal is located at:
http://www.springframework.org

View File

@@ -1,2 +0,0 @@
#!/bin/sh
mvn -Dmaven.test.skip=true -P release clean javadoc:javadoc docbkx:generate-html docbkx:generate-pdf install

View File

@@ -1,85 +0,0 @@
<?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">
<wsdl:types>
<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>
<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>
</wsdl:types>
<wsdl:message name="BookFlightRequest">
<wsdl:part element="sch0:BookFlightRequest" name="BookFlightRequest">
</wsdl:part>
</wsdl:message>
<wsdl:message name="GetFlightsResponse">
<wsdl:part element="sch0:GetFlightsResponse" name="GetFlightsResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="BookFlightResponse">
<wsdl:part element="sch0:BookFlightResponse" name="BookFlightResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="GetFrequentFlyerMileageRequest">
<wsdl:part element="sch0:GetFrequentFlyerMileageRequest" name="GetFrequentFlyerMileageRequest">
</wsdl:part>
</wsdl:message>
<wsdl:message name="GetFlightsRequest">
<wsdl:part element="sch0:GetFlightsRequest" name="GetFlightsRequest">
</wsdl:part>
</wsdl:message>
<wsdl:message name="GetFrequentFlyerMileageResponse">
<wsdl:part element="sch0:GetFrequentFlyerMileageResponse" name="GetFrequentFlyerMileageResponse">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="Airline">
<wsdl:operation name="BookFlight">
<wsdl:input message="tns:BookFlightRequest" name="BookFlightRequest">
</wsdl:input>
<wsdl:output message="tns:BookFlightResponse" name="BookFlightResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetFlights">
<wsdl:input message="tns:GetFlightsRequest" name="GetFlightsRequest">
</wsdl:input>
<wsdl:output message="tns:GetFlightsResponse" name="GetFlightsResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetFrequentFlyerMileage">
<wsdl:input message="tns:GetFrequentFlyerMileageRequest" name="GetFrequentFlyerMileageRequest">
</wsdl:input>
<wsdl:output message="tns:GetFrequentFlyerMileageResponse" name="GetFrequentFlyerMileageResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AirlineSoap11" type="tns:Airline">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="BookFlight">
<soap:operation soapAction=""/>
<wsdl:input name="BookFlightRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="BookFlightResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetFlights">
<soap:operation soapAction=""/>
<wsdl:input name="GetFlightsRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="GetFlightsResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetFrequentFlyerMileage">
<soap:operation soapAction=""/>
<wsdl:input name="GetFrequentFlyerMileageRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="GetFrequentFlyerMileageResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AirlineService">
<wsdl:port binding="tns:AirlineSoap11" name="AirlineSoap11">
<soap:address location="http://localhost:8080/airline-server/services"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

View File

@@ -1,71 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>airline-client</artifactId>
<groupId>org.springframework.ws</groupId>
<version>2.1.5.RELEASE-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>airline-axis1-client</artifactId>
<packaging>jar</packaging>
<name>Spring WS Airline Sample - Axis 1 Client</name>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>axistools-maven-plugin</artifactId>
<configuration>
<urls>
<url>file://${project.basedir}/../airline.wsdl</url>
</urls>
<packageSpace>org.springframework.ws.samples.airline.client.axis1</packageSpace>
</configuration>
<executions>
<execution>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.springframework.ws.samples.airline.client.axis1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>axis</groupId>
<artifactId>axis-jaxrpc</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-discovery</groupId>
<artifactId>commons-discovery</artifactId>
<version>0.4</version>
</dependency>
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -1,10 +0,0 @@
SPRING WEB SERVICES
This directory contains a Java client for the Airline Web Service that uses JAX-RPC.
The client can be run from the provided ant file, by calling "ant run".
SAJA Client Sample table of contents
---------------------------------------------------
* src - The source files for the client
* build.xml - Ant build file with a 'build' and a 'run' target

View File

@@ -1,94 +0,0 @@
/*
* Copyright 2006 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.client.axis1;
import java.rmi.RemoteException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Calendar;
import javax.xml.rpc.ServiceException;
/**
* Simple client that calls the <code>GetFlights</code> and <code>BookFlight</code> operations using JAX-RPC (Axis 1).
*
* @author Arjen Poutsma
*/
public class Main {
public static void main(String[] args) throws ServiceException, RemoteException {
AirlineServiceLocator service = new AirlineServiceLocator();
if (args.length > 0) {
service.setAirlineSoap11EndpointAddress(args[0]);
}
Airline airline = service.getAirlineSoap11();
GetFlightsRequest request = new GetFlightsRequest();
request.setFrom("AMS");
request.setTo("VCE");
Calendar departureCalendar = Calendar.getInstance();
departureCalendar.set(Calendar.YEAR, 2006);
departureCalendar.set(Calendar.MONTH, Calendar.JANUARY);
departureCalendar.set(Calendar.DATE, 31);
Date departureDate = departureCalendar.getTime();
request.setDepartureDate(departureDate);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
System.out.println("Requesting flights on " + dateFormat.format(departureDate));
Flight[] flights = airline.getFlights(request).getFlight();
System.out.println("Got " + flights.length + " results");
if (flights.length > 0)
{
// Book the first flight using John Doe as a frequent flyer
BookFlightRequest bookFlightRequest = new BookFlightRequest();
bookFlightRequest.setFlightNumber(flights[0].getNumber());
bookFlightRequest.setDepartureTime(flights[0].getDepartureTime());
BookFlightRequestPassengers passengers = new BookFlightRequestPassengers();
passengers.setUsername("john");
bookFlightRequest.setPassengers(passengers);
Ticket ticket = airline.bookFlight(bookFlightRequest);
writeTicket(ticket);
}
}
private static void writeTicket(Ticket ticket) {
System.out.println("Ticket " + ticket.getId());
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
System.out.println("Ticket issue date:\t" + dateFormat.format(ticket.getIssueDate()));
for (int i = 0; i < ticket.getPassengers().getPassenger().length; i++) {
writeName(ticket.getPassengers().getPassenger()[i]);
}
writeFlight(ticket.getFlight());
}
private static void writeName(Name name) {
System.out.println("Passenger Name:");
System.out.println(name.getFirst() + " " + name.getLast());
System.out.println("------------");
}
private static void writeFlight(Flight flight) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
System.out.println(dateFormat.format(flight.getDepartureTime().getTime()));
System.out.println(flight.getNumber() + "\t" + flight.getServiceClass());
System.out.println("------------");
System.out.println("Depart:\t" + flight.getFrom().getCode() + "-" + flight.getFrom().getName() + "\t" + dateFormat.format(flight.getDepartureTime().getTime()));
System.out.println("\t" + flight.getFrom().getCity());
System.out.println("Arrive:\t" + flight.getTo().getCode() + "-" + flight.getTo().getName() + "\t" + dateFormat.format(flight.getArrivalTime().getTime()));
System.out.println("\t" + flight.getTo().getCity());
}
}

View File

@@ -1,63 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>airline-client</artifactId>
<groupId>org.springframework.ws</groupId>
<version>2.1.5.RELEASE-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>airline-jax-ws-client</artifactId>
<packaging>jar</packaging>
<name>Spring WS Airline Sample - JAX-WS Client</name>
<profiles>
<profile>
<id>jdk15</id>
<activation>
<jdk>!1.6</jdk>
</activation>
<dependencies>
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>saaj-api</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlUrls>
<wsdlUrl>file://${project.basedir}/../airline.wsdl</wsdlUrl>
</wsdlUrls>
<packageName>org.springframework.ws.samples.airline.client.jaxws</packageName>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.springframework.ws.samples.airline.client.jaxws.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,11 +0,0 @@
SPRING WEB SERVICES
This directory contains a Java client for the Airline Web Service that uses JAX-WS.
The client can be run from the provided ant file, by calling "ant run".
Note that the airline sample has to be running before invoking this target.
Client Sample table of contents
---------------------------------------------------
* src - The source files for the client
* build.xml - Ant build file with a 'build' and a 'run' target

View File

@@ -1,104 +0,0 @@
/*
* Copyright 2006 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.client.jaxws;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeConstants;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
import javax.xml.ws.soap.SOAPFaultException;
/**
* Simple client that calls the <code>GetFlights</code> and <code>BookFlight</code> operations using JAX-WS.
*
* @author Arjen Poutsma
*/
public class Main {
public static void main(String[] args) throws MalformedURLException, DatatypeConfigurationException {
try {
AirlineService service;
if (args.length == 0) {
service = new AirlineService();
}
else {
QName serviceName = new QName("http://www.springframework.org/spring-ws/samples/airline/definitions",
"AirlineService");
service = new AirlineService(new URL(args[0]), serviceName);
}
Airline airline = service.getAirlineSoap11();
GetFlightsRequest request = new GetFlightsRequest();
request.setFrom("AMS");
request.setTo("VCE");
XMLGregorianCalendar departureDate =
DatatypeFactory.newInstance().newXMLGregorianCalendarDate(2006, 1, 31,
DatatypeConstants.FIELD_UNDEFINED);
request.setDepartureDate(departureDate);
System.out.format("Requesting flights on %1tD%n", departureDate.toGregorianCalendar());
GetFlightsResponse response = airline.getFlights(request);
System.out.format("Got %1d results%n", response.getFlight().size());
if (!response.getFlight().isEmpty())
// Book the first flight using John Doe as a frequent flyer
{
Flight flight = response.getFlight().get(0);
BookFlightRequest bookFlightRequest = new BookFlightRequest();
bookFlightRequest.setFlightNumber(flight.getNumber());
bookFlightRequest.setDepartureTime(flight.getDepartureTime());
BookFlightRequest.Passengers passengers = new BookFlightRequest.Passengers();
passengers.getPassengerOrUsername().add("john");
bookFlightRequest.setPassengers(passengers);
Ticket ticket = airline.bookFlight(bookFlightRequest);
writeTicket(ticket);
}
}
catch (SOAPFaultException ex) {
System.out.format("SOAP Fault Code %1s%n", ex.getFault().getFaultCodeAsQName());
System.out.format("SOAP Fault String: %1s%n", ex.getFault().getFaultString());
}
}
private static void writeTicket(Ticket ticket) {
System.out.format("Ticket %1d%n", ticket.getId());
System.out.format("Ticket issue date:\t%1tD%n", ticket.getIssueDate().toGregorianCalendar());
for (Name passenger : ticket.getPassengers().getPassenger()) {
writeName(passenger);
}
writeFlight(ticket.flight);
}
private static void writeName(Name name) {
System.out.format("Passenger Name:%n");
System.out.format("%1s %2s%n", name.getFirst(), name.getLast());
System.out.format("------------%n");
}
private static void writeFlight(Flight flight) {
System.out.format("%1tD%n", flight.getDepartureTime().toGregorianCalendar());
System.out.format("%1s\t%2s%n", flight.getNumber(), flight.getServiceClass());
System.out.format("------------%n");
System.out.format("Depart:\t%1s-%2s\t%tR%n", flight.getFrom().getCode(), flight.getFrom().getName(), flight.getDepartureTime().toGregorianCalendar());
System.out.format("\t%1s%n", flight.getFrom().getCity());
System.out.format("Arrive:\t%1s-%2s\t%tR%n", flight.getTo().getCode(), flight.getTo().getName(), flight.getArrivalTime().toGregorianCalendar());
System.out.format("\t%1s%n", flight.getTo().getCity());
}
}

View File

@@ -1,61 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>airline-client</artifactId>
<groupId>org.springframework.ws</groupId>
<version>2.1.5.RELEASE-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>airline-jms-client</artifactId>
<packaging>jar</packaging>
<name>Spring WS Airline Sample - JMS Client</name>
<profiles>
<profile>
<id>jdk15</id>
<activation>
<jdk>!1.6</jdk>
</activation>
<dependencies>
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>saaj-api</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.springframework.ws.samples.airline.client.jms.JmsClient</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_1.1_spec</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-support</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -1,10 +0,0 @@
SPRING WEB SERVICES
This directory contains a client for the Airline Web Service that uses JMS: Java Message Service. The client can be run
from the provided ant file, by calling "ant run".
JMS Client Sample table of contents
---------------------------------------------------
* src - The source files for the client
* build.xml - Ant build file with a 'build' and a 'run' target

View File

@@ -1,7 +0,0 @@
log4j.rootLogger=WARN, stdout
log4j.logger.org.springframework.ws=DEBUG
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n

View File

@@ -1,48 +0,0 @@
/*
* Copyright 2006 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.client.jms;
import java.io.IOException;
import javax.jms.JMSException;
import javax.xml.soap.SOAPException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.stream.StreamResult;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.ws.client.core.support.WebServiceGatewaySupport;
import org.springframework.xml.transform.StringSource;
/** @author Arjen Poutsma */
public class JmsClient extends WebServiceGatewaySupport {
private static final String PAYLOAD =
"<airline:GetFlightsRequest xmlns:airline=\"http://www.springframework.org/spring-ws/samples/airline/schemas/messages\">" +
"<airline:from>AMS</airline:from>" + "<airline:to>VCE</airline:to>" +
"<airline:departureDate>2006-01-31</airline:departureDate>" + "</airline:GetFlightsRequest>";
public void getFlights() throws SOAPException, IOException, TransformerException, JMSException {
getWebServiceTemplate().sendSourceAndReceiveToResult(new StringSource(PAYLOAD), new StreamResult(System.out));
}
public static void main(String[] args) throws Exception {
ApplicationContext applicationContext =
new ClassPathXmlApplicationContext("applicationContext.xml", JmsClient.class);
JmsClient jmsClient = (JmsClient) applicationContext.getBean("jmsClient", JmsClient.class);
jmsClient.getFlights();
}
}

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616"/>
</bean>
<bean id="jmsClient" class="org.springframework.ws.samples.airline.client.jms.JmsClient">
<property name="defaultUri" value="jms:RequestQueue"/>
<property name="messageSenders">
<bean class="org.springframework.ws.transport.jms.JmsMessageSender">
<property name="connectionFactory" ref="connectionFactory"/>
</bean>
</property>
</bean>
</beans>

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>airline</artifactId>
<groupId>org.springframework.ws</groupId>
<version>2.1.5.RELEASE-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>airline-client</artifactId>
<packaging>pom</packaging>
<name>Spring WS Airline Sample - Clients</name>
<modules>
<module>saaj</module>
<module>axis1</module>
<module>spring-ws</module>
<module>jms</module>
<module>jax-ws</module>
</modules>
</project>

View File

@@ -1,6 +0,0 @@
target
*.iml
.classpath
.project
.settings

View File

@@ -1,75 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>airline-client</artifactId>
<groupId>org.springframework.ws</groupId>
<version>2.1.5.RELEASE-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>airline-saaj-client</artifactId>
<packaging>jar</packaging>
<name>Spring WS Airline Sample - SAAJ Client</name>
<profiles>
<profile>
<id>jdk15</id>
<activation>
<jdk>!1.6</jdk>
</activation>
<dependencies>
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>saaj-api</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.messaging.saaj</groupId>
<artifactId>saaj-impl</artifactId>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</dependency>
<dependency>
<groupId>com.sun.org.apache.xml.security</groupId>
<artifactId>xmlsec</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
<repositories>
<repository>
<id>jboss.repository.releases.public</id>
<name>JBoss Repo Public</name>
<url>http://repository.jboss.org/nexus/content/groups/public-jboss</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.springframework.ws.samples.airline.client.saaj.Driver</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.sun.xml.wsit</groupId>
<artifactId>xws-security</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.wsit</groupId>
<artifactId>wsit-rt</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -1,11 +0,0 @@
SPRING WEB SERVICES
This directory contains two Java clients for the Airline Web Service that use SAAJ: SOAP with Attachments API for Java.
There is a client for the GetFlights operation and a client for the secure GetFrequentFlyerMileage operation. Both
clients can be run from the provided ant file, by calling "ant run".
SAJA Client Sample table of contents
---------------------------------------------------
* src - The source files for the client
* build.xml - Ant build file with a 'build' and a 'run' target

View File

@@ -1,41 +0,0 @@
/*
* 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.client.saaj;
/**
* @author Arjen Poutsma
*/
public class Driver {
public static void main(String[] args) throws Exception {
String url = "http://localhost:8080/airline-server/services";
if (args.length > 0) {
url = args[0];
}
GetFlights getFlights = new GetFlights(url);
getFlights.getFlights();
if (!System.getProperty("java.version").startsWith("1.5")) {
return;
}
String username = "john";
String password = "changeme";
GetFrequentFlyerMileage getMileage = new GetFrequentFlyerMileage(url);
getMileage.getMileage(username, password);
}
}

View File

@@ -1,117 +0,0 @@
/*
* 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.client.saaj;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFault;
import javax.xml.soap.SOAPMessage;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
/**
* Simple client that calls the <code>GetFlights</code> operation using SAAJ.
*
* @author Arjen Poutsma
*/
public class GetFlights {
public static final String NAMESPACE_URI = "http://www.springframework.org/spring-ws/samples/airline/schemas/messages";
public static final String PREFIX = "airline";
private SOAPConnectionFactory connectionFactory;
private MessageFactory messageFactory;
private URL url;
private TransformerFactory transfomerFactory;
public GetFlights(String url) throws SOAPException, MalformedURLException {
connectionFactory = SOAPConnectionFactory.newInstance();
messageFactory = MessageFactory.newInstance();
transfomerFactory = TransformerFactory.newInstance();
this.url = new URL(url);
}
private SOAPMessage createGetFlightsRequest() throws SOAPException {
SOAPMessage message = messageFactory.createMessage();
SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
Name getFlightsRequestName = envelope.createName("GetFlightsRequest", PREFIX, NAMESPACE_URI);
SOAPBodyElement getFlightsRequestElement = message.getSOAPBody().addBodyElement(getFlightsRequestName);
Name fromName = envelope.createName("from", PREFIX, NAMESPACE_URI);
SOAPElement fromElement = getFlightsRequestElement.addChildElement(fromName);
fromElement.setValue("AMS");
Name toName = envelope.createName("to", PREFIX, NAMESPACE_URI);
SOAPElement toElement = getFlightsRequestElement.addChildElement(toName);
toElement.setValue("VCE");
Name departureDateName = envelope.createName("departureDate", PREFIX, NAMESPACE_URI);
SOAPElement departureDateElement = getFlightsRequestElement.addChildElement(departureDateName);
departureDateElement.setValue("2006-01-31");
return message;
}
public void getFlights() throws SOAPException, IOException, TransformerException {
SOAPMessage request = createGetFlightsRequest();
SOAPConnection connection = connectionFactory.createConnection();
SOAPMessage response = connection.call(request, url);
if (!response.getSOAPBody().hasFault()) {
writeGetFlightsResponse(response);
}
else {
SOAPFault fault = response.getSOAPBody().getFault();
System.err.println("Received SOAP Fault");
System.err.println("SOAP Fault Code: " + fault.getFaultCode());
System.err.println("SOAP Fault String: " + fault.getFaultString());
}
}
private void writeGetFlightsResponse(SOAPMessage message) throws SOAPException, TransformerException {
SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
Name getFlightsResponseName = envelope.createName("GetFlightsResponse", PREFIX, NAMESPACE_URI);
SOAPBodyElement getFlightsResponseElement =
(SOAPBodyElement) message.getSOAPBody().getChildElements(getFlightsResponseName).next();
Name flightName = envelope.createName("flight", PREFIX, NAMESPACE_URI);
Iterator iterator = getFlightsResponseElement.getChildElements(flightName);
Transformer transformer = transfomerFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
int count = 1;
while (iterator.hasNext()) {
System.out.println("Flight " + count);
System.out.println("--------");
SOAPElement flightElement = (SOAPElement) iterator.next();
DOMSource source = new DOMSource(flightElement);
transformer.transform(source, new StreamResult(System.out));
}
}
}

View File

@@ -1,128 +0,0 @@
/*
* 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.client.saaj;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFault;
import javax.xml.soap.SOAPMessage;
import com.sun.xml.wss.ProcessingContext;
import com.sun.xml.wss.XWSSProcessor;
import com.sun.xml.wss.XWSSProcessorFactory;
import com.sun.xml.wss.XWSSecurityException;
import com.sun.xml.wss.impl.callback.PasswordCallback;
import com.sun.xml.wss.impl.callback.UsernameCallback;
/**
* Simple client that calls the WS-Security <code>GetFrequentFlyerMileage</code> operation using SAAJ and XWSS.
*
* @author Arjen Poutsma
*/
public class GetFrequentFlyerMileage {
public static final String NAMESPACE_URI = "http://www.springframework.org/spring-ws/samples/airline/schemas/messages";
public static final String PREFIX = "airline";
private SOAPConnectionFactory connectionFactory;
private MessageFactory messageFactory;
private URL url;
private XWSSProcessorFactory processorFactory;
public GetFrequentFlyerMileage(String url) throws SOAPException, MalformedURLException, XWSSecurityException {
connectionFactory = SOAPConnectionFactory.newInstance();
messageFactory = MessageFactory.newInstance();
processorFactory = XWSSProcessorFactory.newInstance();
this.url = new URL(url);
}
private SOAPMessage createGetMileageRequest() throws SOAPException {
SOAPMessage message = messageFactory.createMessage();
SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
Name getFlightsRequestName = envelope.createName("GetFrequentFlyerMileageRequest", GetFrequentFlyerMileage.PREFIX,
GetFrequentFlyerMileage.NAMESPACE_URI);
message.getSOAPBody().addBodyElement(getFlightsRequestName);
return message;
}
private SOAPMessage secureMessage(SOAPMessage message, final String username, final String password)
throws IOException, XWSSecurityException {
CallbackHandler callbackHandler = new CallbackHandler() {
public void handle(Callback[] callbacks) throws UnsupportedCallbackException {
for (int i = 0; i < callbacks.length; i++) {
if (callbacks[i] instanceof UsernameCallback) {
UsernameCallback callback = (UsernameCallback) callbacks[i];
callback.setUsername(username);
}
else if (callbacks[i] instanceof PasswordCallback) {
PasswordCallback callback = (PasswordCallback) callbacks[i];
callback.setPassword(password);
}
else {
throw new UnsupportedCallbackException(callbacks[i]);
}
}
}
};
InputStream policyStream = null;
XWSSProcessor processor = null;
try {
policyStream = getClass().getResourceAsStream("securityPolicy.xml");
processor = processorFactory.createProcessorForSecurityConfiguration(policyStream, callbackHandler);
}
finally {
if (policyStream != null) {
policyStream.close();
}
}
ProcessingContext context = processor.createProcessingContext(message);
return processor.secureOutboundMessage(context);
}
public void getMileage(String username, String password) throws SOAPException, IOException, XWSSecurityException {
SOAPMessage request = createGetMileageRequest();
request = secureMessage(request, username, password);
SOAPConnection connection = connectionFactory.createConnection();
SOAPMessage response = connection.call(request, url);
if (!response.getSOAPBody().hasFault()) {
SOAPBodyElement mileage = (SOAPBodyElement) response.getSOAPBody().getChildElements().next();
System.out.println("'" + username + "' has " + mileage.getValue() + " frequent flyer miles");
}
else {
SOAPFault fault = response.getSOAPBody().getFault();
System.err.println("Received SOAP Fault");
System.err.println("SOAP Fault Code: " + fault.getFaultCode());
System.err.println("SOAP Fault String: " + fault.getFaultString());
}
}
}

View File

@@ -1,3 +0,0 @@
<xwss:SecurityConfiguration dumpMessages="false" xmlns:xwss="http://java.sun.com/xml/ns/xwss/config">
<xwss:UsernameToken digestPassword="true" useNonce="true"/>
</xwss:SecurityConfiguration>

View File

@@ -1,6 +0,0 @@
target
*.iml
.classpath
.project
.settings

View File

@@ -1,106 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>airline-client</artifactId>
<groupId>org.springframework.ws</groupId>
<version>2.1.5.RELEASE-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>airline-spring-ws-client</artifactId>
<packaging>jar</packaging>
<name>Spring WS Airline Sample - Spring-WS Client</name>
<profiles>
<profile>
<id>jdk15</id>
<activation>
<jdk>!1.6</jdk>
</activation>
<dependencies>
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>saaj-api</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xmlbeans-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>xmlbeans</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaDirectory>${project.basedir}/../../server/src/main/webapp/</schemaDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.springframework.ws.samples.airline.client.sws.Driver</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-xml</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ws.security</groupId>
<artifactId>wss4j</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@@ -1,7 +0,0 @@
log4j.rootLogger=WARN, stdout
log4j.logger.org.springframework.ws=DEBUG
log4j.logger.org.springframework.xml=DEBUG
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n

View File

@@ -1,39 +0,0 @@
/*
* 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.client.sws;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
* @author Arjen Poutsma
*/
public class Driver {
public static void main(String[] args) {
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
"org/springframework/ws/samples/airline/client/sws/applicationContext.xml");
GetFlights getFlights = applicationContext.getBean("getFlights", GetFlights.class);
getFlights.getFlights();
GetFrequentFlyerMileage getFrequentFlyerMileage = applicationContext
.getBean("getFrequentFlyerMileage", GetFrequentFlyerMileage.class);
getFrequentFlyerMileage.getFrequentFlyerMileage();
}
}

View File

@@ -1,102 +0,0 @@
/*
* 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.client.sws;
import java.text.SimpleDateFormat;
import java.util.Calendar;
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.WebServiceMessageFactory;
import org.springframework.ws.client.core.support.WebServiceGatewaySupport;
public class GetFlights extends WebServiceGatewaySupport {
public GetFlights(WebServiceMessageFactory messageFactory) {
super(messageFactory);
}
public void getFlights() {
GetFlightsRequestDocument getFlightsRequestDocument = GetFlightsRequestDocument.Factory.newInstance();
GetFlightsRequestDocument.GetFlightsRequest getFlightsRequest =
getFlightsRequestDocument.addNewGetFlightsRequest();
getFlightsRequest.setFrom("AMS");
getFlightsRequest.setTo("VCE");
Calendar departureDate = Calendar.getInstance();
departureDate.clear();
departureDate.set(2006, Calendar.JANUARY, 31);
getFlightsRequest.setDepartureDate(departureDate);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
System.out.println("Requesting flights on " + dateFormat.format(departureDate.getTime()));
GetFlightsResponseDocument getFlightsResponseDocument =
(GetFlightsResponseDocument) getWebServiceTemplate().marshalSendAndReceive(getFlightsRequestDocument);
GetFlightsResponseDocument.GetFlightsResponse response = getFlightsResponseDocument.getGetFlightsResponse();
System.out.println("Got " + response.sizeOfFlightArray() + " results");
if (response.sizeOfFlightArray() > 0) {
// Book the first flight using John Doe as a frequent flyer
BookFlightRequestDocument bookFlightRequestDocument = BookFlightRequestDocument.Factory.newInstance();
BookFlightRequestDocument.BookFlightRequest bookFlightRequest =
bookFlightRequestDocument.addNewBookFlightRequest();
bookFlightRequest.setFlightNumber(response.getFlightArray(0).getNumber());
bookFlightRequest.setDepartureTime(response.getFlightArray(0).getDepartureTime());
BookFlightRequestDocument.BookFlightRequest.Passengers passengers = bookFlightRequest.addNewPassengers();
passengers.addUsername("john");
BookFlightResponseDocument bookFlightResponseDocument = (BookFlightResponseDocument) getWebServiceTemplate()
.marshalSendAndReceive(bookFlightRequestDocument);
Ticket ticket = bookFlightResponseDocument.getBookFlightResponse();
writeTicket(ticket);
}
}
private void writeTicket(Ticket ticket) {
System.out.println("Ticket " + ticket.getId());
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
System.out.println("Ticket issue date:\t" + dateFormat.format(ticket.getIssueDate().getTime()));
for (int i = 0; i < ticket.getPassengers().sizeOfPassengerArray(); i++) {
writeName(ticket.getPassengers().getPassengerArray(i));
}
writeFlight(ticket.getFlight());
}
private void writeName(Name name) {
System.out.println("Passenger Name:");
System.out.println(name.getFirst() + " " + name.getLast());
System.out.println("------------");
}
private void writeFlight(Flight flight) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
System.out.println(dateFormat.format(flight.getDepartureTime().getTime()));
System.out.println(flight.getNumber() + "\t" + flight.getServiceClass());
System.out.println("------------");
System.out.println("Depart:\t" + flight.getFrom().getCode() + "-" + flight.getFrom().getName() + "\t" +
dateFormat.format(flight.getDepartureTime().getTime()));
System.out.println("\t" + flight.getFrom().getCity());
System.out.println("Arrive:\t" + flight.getTo().getCode() + "-" + flight.getTo().getName() + "\t" +
dateFormat.format(flight.getArrivalTime().getTime()));
System.out.println("\t" + flight.getTo().getCity());
}
}

View File

@@ -1,40 +0,0 @@
/*
* 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.client.sws;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamResult;
import org.springframework.ws.WebServiceMessageFactory;
import org.springframework.ws.client.core.support.WebServiceGatewaySupport;
import org.springframework.xml.transform.StringSource;
public class GetFrequentFlyerMileage extends WebServiceGatewaySupport {
public GetFrequentFlyerMileage(WebServiceMessageFactory messageFactory) {
super(messageFactory);
}
public void getFrequentFlyerMileage() {
Source source = new StringSource(
"<GetFrequentFlyerMileageRequest xmlns=\"http://www.springframework.org/spring-ws/samples/airline/schemas/messages\" />");
getWebServiceTemplate().sendSourceAndReceiveToResult(source, new StreamResult(System.out));
}
}

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory"/>
<bean id="abstractClient" abstract="true">
<constructor-arg ref="messageFactory"/>
<property name="defaultUri" value="http://localhost:8080/airline-server/services"/>
</bean>
<bean id="marshaller" class="org.springframework.oxm.xmlbeans.XmlBeansMarshaller"/>
<bean id="getFlights" parent="abstractClient" class="org.springframework.ws.samples.airline.client.sws.GetFlights">
<property name="marshaller" ref="marshaller"/>
<property name="unmarshaller" ref="marshaller"/>
</bean>
<bean id="getFrequentFlyerMileage" parent="abstractClient"
class="org.springframework.ws.samples.airline.client.sws.GetFrequentFlyerMileage">
<property name="interceptors" ref="securityInterceptor"/>
</bean>
<bean id="securityInterceptor" class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
<property name="securementActions" value="UsernameToken"/>
<property name="securementUsername" value="john"/>
<property name="securementPassword" value="changeme"/>
</bean>
</beans>

View File

@@ -1,3 +0,0 @@
<xwss:SecurityConfiguration dumpMessages="false" xmlns:xwss="http://java.sun.com/xml/ns/xwss/config">
<xwss:UsernameToken digestPassword="true" useNonce="true"/>
</xwss:SecurityConfiguration>

View File

@@ -1,100 +0,0 @@
/*
* Copyright 2005-2010 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.client.sws;
import java.util.Collections;
import java.util.Map;
import javax.xml.transform.Source;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.xml.transform.StringSource;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.ws.test.client.MockWebServiceServer;
import static org.springframework.ws.test.client.RequestMatchers.*;
import static org.springframework.ws.test.client.ResponseCreators.*;
/**
* This test illustrates the use of the client-side testing API, introduced in Spring-WS 2.0.
*
* @author Arjen Poutsma
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("applicationContext.xml")
public class GetFlightsTest {
@Autowired
GetFlights getFlights;
private MockWebServiceServer mockServer;
private static final String MESSAGES_NS =
"http://www.springframework.org/spring-ws/samples/airline/schemas/messages";
private static final String TYPES_NS = "http://www.springframework.org/spring-ws/samples/airline/schemas/types";
@Before
public void setUpMocks() throws Exception {
mockServer = MockWebServiceServer.createServer(getFlights);
}
@Test
public void getFlights() throws Exception {
Source getFlightsRequest = new StringSource(
"<GetFlightsRequest xmlns='" + MESSAGES_NS + "'>" + "<from>AMS</from>" + "<to>VCE</to>" +
"<departureDate>2006-01-31</departureDate>" + "</GetFlightsRequest>");
String flightInfo =
"<t:number>KL1653</t:number>" + "<t:departureTime>2006-01-31T10:05:00.000+01:00</t:departureTime>" +
"<t:from><t:code>AMS</t:code><t:name>Schiphol Airport</t:name><t:city>Amsterdam</t:city></t:from>" +
"<t:arrivalTime>2006-01-31T12:25:00.000+01:00</t:arrivalTime>" +
"<t:to><t:code>VCE</t:code><t:name>Marco Polo Airport</t:name><t:city>Venice</t:city></t:to>" +
"<t:serviceClass>economy</t:serviceClass>";
Source getFlightsResponse = new StringSource(
"<m:GetFlightsResponse xmlns:m='" + MESSAGES_NS + "' xmlns:t='" + TYPES_NS + "'>" + "<m:flight>" +
flightInfo + "</m:flight>" + "</m:GetFlightsResponse>");
mockServer.expect(payload(getFlightsRequest)).andRespond(withPayload(getFlightsResponse));
Source bookFlightResponse = new StringSource(
"<m:BookFlightResponse xmlns:m='" + MESSAGES_NS + "' xmlns:t='" + TYPES_NS + "'>" + "<t:id>4</t:id>" +
"<t:issueDate>2010-07-28</t:issueDate>" +
"<t:passengers><t:passenger><t:first>John</t:first><t:last>Doe</t:last></t:passenger></t:passengers>" +
"<t:flight>" + flightInfo + "</t:flight>" + "</m:BookFlightResponse>");
Map<String, String> namespaces = Collections.singletonMap("m", MESSAGES_NS);
mockServer.expect(xpath("/m:BookFlightRequest/m:flightNumber", namespaces).exists())
.andExpect(xpath("/m:BookFlightRequest/m:departureTime", namespaces).exists())
.andExpect(xpath("/m:BookFlightRequest/m:passengers", namespaces).exists())
.andRespond(withPayload(bookFlightResponse));
getFlights.getFlights();
mockServer.verify();
}
}

View File

@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>spring-ws-samples</artifactId>
<groupId>org.springframework.ws</groupId>
<version>2.1.5.RELEASE-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>airline</artifactId>
<packaging>pom</packaging>
<name>Spring WS Airline Sample</name>
<modules>
<module>server</module>
<module>client</module>
</modules>
</project>

View File

@@ -1,23 +0,0 @@
=====================================================
== Spring Web Service Airline sample application ==
=====================================================
1. INTRODUCTION
Features a web service on top of an airline reservation system, backed by a database. The web service works by using XML
Marshalling techniques (JAXB2), and XPath in combination with XPath queries to pull information from a message.
Additionally, the Airline service has JMS support. All messages follow the messages.xsd schema in src/main/webapp.
2. INSTALLATION
The Airline sample is a normal web application that connects to an embedded
HSQLDB database. It requires JDK 1.5 to run; JDK 1.6 works as well, except for
the WS-Security endpoints.
To execute the sample, run "mvn jetty:run" in the server directory to run the sample in the Jetty6 Web container.
To create a war file instead of running in Jetty, use "mvn package".
3. THE CLIENTS
Simply run "mvn install exec:java" in each of the client subdirectories.

View File

@@ -1,6 +0,0 @@
target
*.iml
.classpath
.project
.settings

View File

@@ -1,269 +0,0 @@
<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">
<parent>
<artifactId>airline</artifactId>
<groupId>org.springframework.ws</groupId>
<version>2.1.5.RELEASE-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>airline-server</artifactId>
<packaging>war</packaging>
<name>Spring WS Airline Sample - Server</name>
<profiles>
<profile>
<id>jdk15</id>
<activation>
<jdk>!1.6</jdk>
</activation>
<dependencies>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.1</version>
<exclusions>
<exclusion>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.1.5</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>saaj-api</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.messaging.saaj</groupId>
<artifactId>saaj-impl</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaDirectory>src/main/webapp/</schemaDirectory>
<packageName>org.springframework.ws.samples.airline.schema</packageName>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
<includes>org/springframework/ws/samples/airline/domain/*.class</includes>
<excludes>org/springframework/ws/samples/airline/domain/ServiceClass.class</excludes>
</configuration>
<executions>
<execution>
<id>enhancer</id>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Spring-WS dependencies -->
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-xml</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-support</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-asl</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-security</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.ws.security</groupId>
<artifactId>wss4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Spring dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
<!-- JEE dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_1.1_spec</artifactId>
<scope>runtime</scope>
</dependency>
<!-- O/R Mapping dependencies -->
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.2.1</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xerces</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.7</version>
<scope>runtime</scope>
</dependency>
<!-- Various dependencies -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time-jsptags</artifactId>
<version>1.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.5.3</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.3.1.4</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.ws.xmlschema</groupId>
<artifactId>xmlschema-core</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -1,36 +0,0 @@
/*
* Copyright 2005 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.dao;
import java.util.List;
import org.joda.time.DateTime;
import org.joda.time.Interval;
import org.springframework.dao.DataAccessException;
import org.springframework.ws.samples.airline.domain.Flight;
import org.springframework.ws.samples.airline.domain.ServiceClass;
public interface FlightDao {
List<Flight> findFlights(String fromAirportCode, String toAirportCode, Interval interval, ServiceClass serviceClass)
throws DataAccessException;
Flight getFlight(Long id);
Flight getFlight(String flightNumber, DateTime departureTime);
Flight update(Flight flight);
}

View File

@@ -1,26 +0,0 @@
/*
* Copyright 2006 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.dao;
import org.springframework.dao.DataAccessException;
import org.springframework.ws.samples.airline.domain.FrequentFlyer;
public interface FrequentFlyerDao {
FrequentFlyer get(String username) throws DataAccessException;
}

View File

@@ -1,26 +0,0 @@
/*
* Copyright 2006 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.dao;
import org.springframework.dao.DataAccessException;
import org.springframework.ws.samples.airline.domain.Ticket;
public interface TicketDao {
void save(Ticket ticket) throws DataAccessException;
}

View File

@@ -1,108 +0,0 @@
/*
* 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.dao.jpa;
import javax.annotation.PostConstruct;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallbackWithoutResult;
import org.springframework.transaction.support.TransactionTemplate;
import org.springframework.ws.samples.airline.domain.Airport;
import org.springframework.ws.samples.airline.domain.Flight;
import org.springframework.ws.samples.airline.domain.FrequentFlyer;
import org.springframework.ws.samples.airline.domain.ServiceClass;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.joda.time.DateTime;
/**
* A simple class that uses JPA to initialize the database.
*
* @author Arjen Poutsma
* @since 1.5.0
*/
@Component
public class DatabaseInitializer {
private static final Log logger = LogFactory.getLog(DatabaseInitializer.class);
private final TransactionTemplate transactionTemplate;
@PersistenceContext
private EntityManager entityManager;
private Airport amsterdam;
private Airport venice;
@Autowired
public DatabaseInitializer(PlatformTransactionManager transactionManager) {
this.transactionTemplate = new TransactionTemplate(transactionManager);
}
@PostConstruct
public void initDatabase() {
transactionTemplate.execute(new TransactionCallbackWithoutResult() {
protected void doInTransactionWithoutResult(TransactionStatus transactionStatus) {
logger.info("Initializing Database");
createAirports();
createFlights();
createFrequentFlyers();
}
});
}
private void createAirports() {
amsterdam = new Airport("AMS", "Schiphol Airport", "Amsterdam");
entityManager.persist(amsterdam);
venice = new Airport("VCE", "Marco Polo Airport", "Venice");
entityManager.persist(venice);
}
private void createFlights() {
Flight flight = new Flight();
flight.setNumber("KL1653");
flight.setDepartureTime(new DateTime(2006, 1, 31, 10, 5, 0, 0));
flight.setFrom(amsterdam);
flight.setArrivalTime(new DateTime(2006, 1, 31, 12, 25, 0, 0));
flight.setTo(venice);
flight.setServiceClass(ServiceClass.ECONOMY);
flight.setSeatsAvailable(5);
flight.setMiles(200);
entityManager.persist(flight);
flight = new Flight();
flight.setNumber("KL1654");
flight.setDepartureTime(new DateTime(2006, 2, 5, 12, 40, 0, 0));
flight.setFrom(venice);
flight.setArrivalTime(new DateTime(2006, 2, 5, 14, 15, 0, 0));
flight.setTo(amsterdam);
flight.setServiceClass(ServiceClass.ECONOMY);
flight.setSeatsAvailable(5);
flight.setMiles(200);
entityManager.persist(flight);
}
private void createFrequentFlyers() {
entityManager.persist(new FrequentFlyer("John", "Doe", "john", "changeme"));
}
}

View File

@@ -1,74 +0,0 @@
/*
* Copyright 2007 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.dao.jpa;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import org.joda.time.DateTime;
import org.joda.time.Interval;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;
import org.springframework.ws.samples.airline.dao.FlightDao;
import org.springframework.ws.samples.airline.domain.Flight;
import org.springframework.ws.samples.airline.domain.ServiceClass;
@Repository
public class JpaFlightDao implements FlightDao {
@PersistenceContext
private EntityManager entityManager;
public List<Flight> findFlights(String fromAirportCode,
String toAirportCode,
Interval interval,
ServiceClass serviceClass) throws DataAccessException {
Query query = entityManager.createQuery("SELECT f FROM Flight f WHERE f.from.code = :fromParam " +
"AND f.to.code = :toParam AND f.departureTime >= :start AND f.departureTime <= :end AND " +
"f.serviceClass = :class");
query.setParameter("fromParam", fromAirportCode);
query.setParameter("toParam", toAirportCode);
query.setParameter("start", interval.getStart());
query.setParameter("end", interval.getEnd());
query.setParameter("class", serviceClass);
return query.getResultList();
}
public Flight getFlight(Long id) {
return entityManager.find(Flight.class, id);
}
public Flight getFlight(String flightNumber, DateTime departureTime) {
Query query = entityManager
.createQuery("SELECT f FROM Flight f WHERE f.number = :number AND f.departureTime = :departureTime");
query.setParameter("number", flightNumber);
query.setParameter("departureTime", departureTime);
try {
return (Flight) query.getSingleResult();
}
catch (NoResultException e) {
return null;
}
}
public Flight update(Flight flight) {
return entityManager.merge(flight);
}
}

View File

@@ -1,46 +0,0 @@
/*
* Copyright 2007 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.dao.jpa;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;
import org.springframework.ws.samples.airline.dao.FrequentFlyerDao;
import org.springframework.ws.samples.airline.domain.FrequentFlyer;
@Repository
public class JpaFrequentFlyerDao implements FrequentFlyerDao {
@PersistenceContext
private EntityManager entityManager;
public FrequentFlyer get(String username) throws DataAccessException {
Query query = entityManager.createQuery("SELECT f FROM FrequentFlyer f WHERE f.username = :username");
query.setParameter("username", username);
try {
return (FrequentFlyer) query.getSingleResult();
}
catch (NoResultException e) {
return null;
}
}
}

View File

@@ -1,36 +0,0 @@
/*
* Copyright 2007 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.dao.jpa;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;
import org.springframework.ws.samples.airline.dao.TicketDao;
import org.springframework.ws.samples.airline.domain.Ticket;
@Repository
public class JpaTicketDao implements TicketDao {
@PersistenceContext
private EntityManager entityManager;
public void save(Ticket ticket) throws DataAccessException {
entityManager.persist(ticket);
}
}

View File

@@ -1,74 +0,0 @@
/*
* Copyright 2006 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.domain;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "AIRPORT")
public class Airport implements Serializable {
@Id
@Column(name = "CODE")
private String code;
@Column(name = "NAME")
private String name;
@Column(name = "CITY")
private String city;
public Airport() {
}
public Airport(String code, String name, String city) {
this.code = code;
this.name = name;
this.city = city;
}
public String getCity() {
return city;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (!(other instanceof Airport)) {
return false;
}
final Airport that = (Airport) other;
return code.equals(that.code);
}
public int hashCode() {
return code.hashCode();
}
}

View File

@@ -1,179 +0,0 @@
/*
* Copyright 2005, 2006 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.domain;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.apache.openjpa.persistence.Persistent;
import org.joda.time.DateTime;
@Entity
@Table(name = "FLIGHT")
public class Flight implements Serializable {
@Id
@Column(name = "ID")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "NUMBER")
private String number;
@Column(name = "DEPARTURE_TIME")
@Persistent
private DateTime departureTime;
@ManyToOne
@JoinColumn(name = "FROM_AIRPORT_CODE", nullable = false)
private Airport from;
@Column(name = "ARRIVAL_TIME")
@Persistent
private DateTime arrivalTime;
@ManyToOne
@JoinColumn(name = "TO_AIRPORT_CODE", nullable = false)
private Airport to;
@Column(name = "SERVICE_CLASS")
@Enumerated(EnumType.STRING)
private ServiceClass serviceClass;
@Column(name = "SEATS_AVAILABLE")
private int seatsAvailable;
@Column(name = "MILES")
private int miles;
public Flight() {
}
public Flight(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public DateTime getArrivalTime() {
return arrivalTime;
}
public void setArrivalTime(DateTime arrivalTime) {
this.arrivalTime = arrivalTime;
}
public DateTime getDepartureTime() {
return departureTime;
}
public void setDepartureTime(DateTime departureTime) {
this.departureTime = departureTime;
}
public Airport getFrom() {
return from;
}
public void setFrom(Airport from) {
this.from = from;
}
public int getMiles() {
return miles;
}
public void setMiles(int miles) {
this.miles = miles;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public int getSeatsAvailable() {
return seatsAvailable;
}
public void setSeatsAvailable(int seatsAvailable) {
this.seatsAvailable = seatsAvailable;
}
public ServiceClass getServiceClass() {
return serviceClass;
}
public void setServiceClass(ServiceClass serviceClass) {
this.serviceClass = serviceClass;
}
public Airport getTo() {
return to;
}
public void setTo(Airport to) {
this.to = to;
}
public void substractSeats(int count) {
seatsAvailable -= count;
}
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final Flight flight = (Flight) o;
if (!departureTime.equals(flight.departureTime)) {
return false;
}
return number.equals(flight.number);
}
public int hashCode() {
int result = number.hashCode();
result = 29 * result + departureTime.hashCode();
return result;
}
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append(getNumber());
buffer.append(' ');
buffer.append(getDepartureTime().toString());
return buffer.toString();
}
}

View File

@@ -1,97 +0,0 @@
/*
* Copyright 2006 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.domain;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
@Entity
@Table(name = "FREQUENT_FLYER")
@PrimaryKeyJoinColumn(name = "PASSENGER_ID")
public class FrequentFlyer extends Passenger {
@Column(name = "USERNAME")
private String username;
@Column(name = "PASSWORD")
private String password;
@Column(name = "MILES")
private int miles;
public FrequentFlyer() {
}
public FrequentFlyer(String username) {
this.username = username;
}
public FrequentFlyer(String firstName, String lastName, String username, String password) {
super(firstName, lastName);
this.username = username;
this.password = password;
}
public int getMiles() {
return miles;
}
public void setMiles(int miles) {
this.miles = miles;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (!(other instanceof FrequentFlyer)) {
return false;
}
final FrequentFlyer that = (FrequentFlyer) other;
return username.equals(that.username);
}
public int hashCode() {
return username.hashCode();
}
public String toString() {
return username;
}
public void addMiles(int miles) {
this.miles += miles;
}
}

View File

@@ -1,99 +0,0 @@
/*
* Copyright 2005, 2006 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.domain;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
@Entity
@Table(name = "PASSENGER")
@Inheritance(strategy = InheritanceType.JOINED)
public class Passenger implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID")
private Long id;
@Column(name = "FIRST_NAME")
private String firstName;
@Column(name = "LAST_NAME")
private String lastName;
public Passenger() {
}
public Passenger(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
public Passenger(Long id, String firstName, String lastName) {
this.id = id;
this.firstName = firstName;
this.lastName = lastName;
}
public String getFirstName() {
return firstName;
}
public Long getId() {
return id;
}
public String getLastName() {
return lastName;
}
public String toString() {
return firstName + " " + lastName;
}
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final Passenger passenger = (Passenger) o;
if (!getFirstName().equals(passenger.getFirstName())) {
return false;
}
if (!getLastName().equals(passenger.getLastName())) {
return false;
}
return true;
}
public int hashCode() {
int result = getFirstName().hashCode();
result = 29 * result + getLastName().hashCode();
return result;
}
}

View File

@@ -1,26 +0,0 @@
/*
* Copyright 2006 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.domain;
public enum ServiceClass {
ECONOMY,
BUSINESS,
FIRST
}

View File

@@ -1,97 +0,0 @@
/*
* Copyright 2006 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.domain;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.apache.openjpa.persistence.Persistent;
import org.joda.time.LocalDate;
@Entity
@Table(name = "TICKET")
public class Ticket implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "ISSUE_DATE")
@Persistent
private LocalDate issueDate;
@ManyToOne
@JoinColumn(name = "FLIGHT_ID", nullable = false)
private Flight flight;
@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
@JoinTable(name = "PASSENGER_TICKET",
joinColumns = @JoinColumn(name = "TICKET_ID"),
inverseJoinColumns = @JoinColumn(name = "PASSENGER_ID"))
private Set<Passenger> passengers = new HashSet<Passenger>();
public Ticket() {
}
public Ticket(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public Flight getFlight() {
return flight;
}
public void setFlight(Flight flight) {
this.flight = flight;
}
public LocalDate getIssueDate() {
return issueDate;
}
public void setIssueDate(LocalDate issueDate) {
this.issueDate = issueDate;
}
public Set<Passenger> getPassengers() {
return passengers;
}
public void setPassengers(Set<Passenger> passengers) {
this.passengers = passengers;
}
public void addPassenger(Passenger passenger) {
passengers.add(passenger);
}
}

View File

@@ -1,57 +0,0 @@
/*
* Copyright 2007 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.domain.openjpa;
import java.sql.Timestamp;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.meta.JavaSQLTypes;
import org.apache.openjpa.jdbc.meta.ValueMapping;
import org.apache.openjpa.jdbc.meta.strats.AbstractValueHandler;
import org.apache.openjpa.jdbc.schema.Column;
import org.apache.openjpa.jdbc.schema.ColumnIO;
import org.joda.time.DateTime;
/**
* @author Arjen Poutsma
* @since 1.1.0
*/
public class DateTimeValueHandler extends AbstractValueHandler {
private static final DateTimeValueHandler instance = new DateTimeValueHandler();
public static DateTimeValueHandler getInstance() {
return instance;
}
public Column[] map(ValueMapping vm, String name, ColumnIO io, boolean adapt) {
Column col = new Column();
col.setName(name);
col.setJavaType(JavaSQLTypes.TIMESTAMP);
return new Column[]{col};
}
@Override
public Object toDataStoreValue(ValueMapping valueMapping, Object val, JDBCStore jdbcStore) {
return val == null ? null : new Timestamp(((DateTime) val).getMillis());
}
@Override
public Object toObjectValue(ValueMapping valueMapping, Object val) {
return val == null ? null : new DateTime(val);
}
}

View File

@@ -1,51 +0,0 @@
/*
* Copyright 2007 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.domain.openjpa;
import java.sql.Date;
import org.apache.openjpa.jdbc.kernel.JDBCStore;
import org.apache.openjpa.jdbc.meta.JavaSQLTypes;
import org.apache.openjpa.jdbc.meta.ValueMapping;
import org.apache.openjpa.jdbc.meta.strats.AbstractValueHandler;
import org.apache.openjpa.jdbc.schema.Column;
import org.apache.openjpa.jdbc.schema.ColumnIO;
import org.joda.time.LocalDate;
/**
* @author Arjen Poutsma
* @since 1.1.0
*/
public class LocalDateValueHandler extends AbstractValueHandler {
public Column[] map(ValueMapping vm, String name, ColumnIO io, boolean adapt) {
Column col = new Column();
col.setName(name);
col.setJavaType(JavaSQLTypes.DATE);
return new Column[]{col};
}
@Override
public Object toDataStoreValue(ValueMapping valueMapping, Object val, JDBCStore jdbcStore) {
return val == null ? null : new Date(((LocalDate) val).toDateMidnight().getMillis());
}
@Override
public Object toObjectValue(ValueMapping valueMapping, Object val) {
return val == null ? null : new LocalDate(val);
}
}

View File

@@ -1,147 +0,0 @@
/*
* Copyright 2007 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.schema.support;
import java.util.ArrayList;
import java.util.List;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeConstants;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.LocalDate;
import org.springframework.ws.samples.airline.domain.Passenger;
import org.springframework.ws.samples.airline.schema.Airport;
import org.springframework.ws.samples.airline.schema.Flight;
import org.springframework.ws.samples.airline.schema.Name;
import org.springframework.ws.samples.airline.schema.ServiceClass;
import org.springframework.ws.samples.airline.schema.Ticket;
/** @author Arjen Poutsma */
public abstract class SchemaConversionUtils {
private SchemaConversionUtils() {
}
public static Flight toSchemaType(org.springframework.ws.samples.airline.domain.Flight domainFlight)
throws DatatypeConfigurationException {
Flight schemaFlight = new Flight();
schemaFlight.setNumber(domainFlight.getNumber());
schemaFlight.setDepartureTime(toXMLGregorianCalendar(domainFlight.getDepartureTime()));
schemaFlight.setFrom(toSchemaType(domainFlight.getFrom()));
schemaFlight.setArrivalTime(toXMLGregorianCalendar(domainFlight.getArrivalTime()));
schemaFlight.setTo(toSchemaType(domainFlight.getTo()));
schemaFlight.setServiceClass(toSchemaType(domainFlight.getServiceClass()));
return schemaFlight;
}
public static List<Flight> toSchemaType(List<org.springframework.ws.samples.airline.domain.Flight> domainFlights)
throws DatatypeConfigurationException {
List<Flight> schemaFlights = new ArrayList<Flight>(domainFlights.size());
for (org.springframework.ws.samples.airline.domain.Flight domainFlight : domainFlights) {
schemaFlights.add(toSchemaType(domainFlight));
}
return schemaFlights;
}
public static XMLGregorianCalendar toXMLGregorianCalendar(DateTime dateTime) throws DatatypeConfigurationException {
DatatypeFactory factory = DatatypeFactory.newInstance();
return factory.newXMLGregorianCalendar(dateTime.toGregorianCalendar());
}
public static DateTime toDateTime(XMLGregorianCalendar calendar) {
int timeZoneMinutes = calendar.getTimezone();
DateTimeZone timeZone = DateTimeZone.forOffsetHoursMinutes(timeZoneMinutes / 60, timeZoneMinutes % 60);
return new DateTime(calendar.getYear(), calendar.getMonth(), calendar.getDay(), calendar.getHour(),
calendar.getMinute(), calendar.getSecond(), calendar.getMillisecond(), timeZone);
}
public static XMLGregorianCalendar toXMLGregorianCalendar(LocalDate localDate)
throws DatatypeConfigurationException {
DatatypeFactory factory = DatatypeFactory.newInstance();
return factory.newXMLGregorianCalendarDate(localDate.getYear(), localDate.getMonthOfYear(),
localDate.getDayOfMonth(), DatatypeConstants.FIELD_UNDEFINED);
}
public static LocalDate toLocalDate(XMLGregorianCalendar calendar) {
return new LocalDate(calendar.getYear(), calendar.getMonth(), calendar.getDay());
}
public static Airport toSchemaType(org.springframework.ws.samples.airline.domain.Airport domainAirport) {
if (domainAirport == null) {
return null;
}
Airport schemaAirport = new Airport();
schemaAirport.setCode(domainAirport.getCode());
schemaAirport.setName(domainAirport.getName());
schemaAirport.setCity(domainAirport.getCity());
return schemaAirport;
}
public static ServiceClass toSchemaType(org.springframework.ws.samples.airline.domain.ServiceClass domainServiceClass) {
switch (domainServiceClass) {
case BUSINESS:
return ServiceClass.BUSINESS;
case ECONOMY:
return ServiceClass.ECONOMY;
case FIRST:
return ServiceClass.FIRST;
default:
throw new IllegalArgumentException("Invalid domain service class: [" + domainServiceClass + "]");
}
}
public static org.springframework.ws.samples.airline.domain.ServiceClass toDomainType(ServiceClass schemaServiceClass) {
if (schemaServiceClass == null) {
return null;
}
switch (schemaServiceClass) {
case BUSINESS:
return org.springframework.ws.samples.airline.domain.ServiceClass.BUSINESS;
case ECONOMY:
return org.springframework.ws.samples.airline.domain.ServiceClass.ECONOMY;
case FIRST:
return org.springframework.ws.samples.airline.domain.ServiceClass.FIRST;
default:
throw new IllegalArgumentException("Invalid schema service class: [" + schemaServiceClass + "]");
}
}
public static Name toSchemaType(org.springframework.ws.samples.airline.domain.Passenger passenger) {
Name name = new Name();
name.setFirst(passenger.getFirstName());
name.setLast(passenger.getLastName());
return name;
}
public static Ticket toSchemaType(org.springframework.ws.samples.airline.domain.Ticket domainTicket)
throws DatatypeConfigurationException {
Ticket schemaTicket = new Ticket();
schemaTicket.setId(domainTicket.getId());
schemaTicket.setFlight(toSchemaType(domainTicket.getFlight()));
schemaTicket.setIssueDate(toXMLGregorianCalendar(domainTicket.getIssueDate()));
if (!domainTicket.getPassengers().isEmpty()) {
schemaTicket.setPassengers(new Ticket.Passengers());
}
for (Passenger passenger : domainTicket.getPassengers()) {
schemaTicket.getPassengers().getPassenger().add(toSchemaType(passenger));
}
return schemaTicket;
}
}

View File

@@ -1,82 +0,0 @@
/*
* Copyright 2006 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.security;
import java.util.ArrayList;
import java.util.Collection;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.GrantedAuthorityImpl;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.ws.samples.airline.domain.FrequentFlyer;
/**
* A wrapper around an <code>FrequentFlyer</code> which provides extra functionality needed to implement the
* <code>UserDetails</code> interface.
*
* @author Arjen Poutsma
*/
public class FrequentFlyerDetails implements UserDetails {
private FrequentFlyer frequentFlyer;
public static final Collection<GrantedAuthority> GRANTED_AUTHORITIES =
new ArrayList<GrantedAuthority>();
{
GRANTED_AUTHORITIES.add(new GrantedAuthorityImpl("ROLE_FREQUENT_FLYER"));
};
public FrequentFlyerDetails(FrequentFlyer frequentFlyer) {
this.frequentFlyer = frequentFlyer;
}
public Collection<GrantedAuthority> getAuthorities() {
return GRANTED_AUTHORITIES;
}
public String getPassword() {
return frequentFlyer.getPassword();
}
public String getUsername() {
return frequentFlyer.getUsername();
}
public boolean isAccountNonExpired() {
return true;
}
public boolean isAccountNonLocked() {
return true;
}
public boolean isCredentialsNonExpired() {
return true;
}
public boolean isEnabled() {
return true;
}
public FrequentFlyer getFrequentFlyer() {
return frequentFlyer;
}
public String toString() {
return frequentFlyer.toString();
}
}

View File

@@ -1,45 +0,0 @@
/*
* Copyright 2006 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.security;
import org.springframework.ws.samples.airline.domain.FrequentFlyer;
import org.springframework.ws.samples.airline.service.NoSuchFrequentFlyerException;
/**
* Defines the business logic for handling frequent flyers.
*
* @author Arjen Poutsma
*/
public interface FrequentFlyerSecurityService {
/**
* Returns the <code>FrequentFlyer</code> with the given username.
*
* @param username the username
* @return the frequent flyer with the given username, or <code>null</code> if not found
* @throws NoSuchFrequentFlyerException when the frequent flyer cannot be found
*/
FrequentFlyer getFrequentFlyer(String username) throws NoSuchFrequentFlyerException;
/**
* Returns the <code>FrequentFlyer</code> that is currently logged in.
*
* @return the frequent flyer that is currently logged in, or <code>null</code> if not found
*/
FrequentFlyer getCurrentlyAuthenticatedFrequentFlyer();
}

View File

@@ -1,86 +0,0 @@
/*
* 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.security;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ws.samples.airline.dao.FrequentFlyerDao;
import org.springframework.ws.samples.airline.domain.FrequentFlyer;
import org.springframework.ws.samples.airline.service.NoSuchFrequentFlyerException;
/**
* Implementation of the <code>FrequentFlyerSecurityService</code> that uses Spring Security.
*
* @author Arjen Poutsma
*/
public class SpringFrequentFlyerSecurityService implements FrequentFlyerSecurityService, UserDetailsService {
private FrequentFlyerDao frequentFlyerDao;
@Autowired
public SpringFrequentFlyerSecurityService(FrequentFlyerDao frequentFlyerDao) {
this.frequentFlyerDao = frequentFlyerDao;
}
@Transactional
public FrequentFlyer getCurrentlyAuthenticatedFrequentFlyer() {
SecurityContext context = SecurityContextHolder.getContext();
Authentication authentication = context.getAuthentication();
if (authentication != null) {
if (authentication.getPrincipal() instanceof FrequentFlyerDetails) {
FrequentFlyerDetails details = (FrequentFlyerDetails) authentication.getPrincipal();
return details.getFrequentFlyer();
}
else {
return (FrequentFlyer) authentication.getPrincipal();
}
}
else {
return null;
}
}
@Transactional
public FrequentFlyer getFrequentFlyer(String username) throws NoSuchFrequentFlyerException {
FrequentFlyer frequentFlyer = frequentFlyerDao.get(username);
if (frequentFlyer != null) {
return frequentFlyer;
}
else {
throw new NoSuchFrequentFlyerException(username);
}
}
@Transactional
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException {
FrequentFlyer frequentFlyer = frequentFlyerDao.get(username);
if (frequentFlyer != null) {
return new FrequentFlyerDetails(frequentFlyer);
}
else {
throw new UsernameNotFoundException("Frequent flyer '" + username + "' not found");
}
}
}

View File

@@ -1,50 +0,0 @@
/*
* Copyright 2006 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.security;
import org.springframework.ws.samples.airline.domain.FrequentFlyer;
import org.springframework.ws.samples.airline.service.NoSuchFrequentFlyerException;
/**
* Stub implementation of <code>FrequentFlyerSecurityService</code>. This implementation is used by default by {@link
* org.springframework.ws.samples.airline.service.impl.AirlineServiceImpl}, to allow it to run without depending on
* Spring Security.
*
* @author Arjen Poutsma
*/
public class StubFrequentFlyerSecurityService implements FrequentFlyerSecurityService {
private FrequentFlyer john;
public StubFrequentFlyerSecurityService() {
john = new FrequentFlyer("John", "Doe", "john", "changeme");
john.setMiles(10);
}
public FrequentFlyer getFrequentFlyer(String username) throws NoSuchFrequentFlyerException {
if (john.getUsername().equals(username)) {
return john;
}
else {
throw new NoSuchFrequentFlyerException(username);
}
}
public FrequentFlyer getCurrentlyAuthenticatedFrequentFlyer() {
return john;
}
}

View File

@@ -1,84 +0,0 @@
/*
* Copyright 2006 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.service;
import java.util.List;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import org.springframework.ws.samples.airline.domain.Flight;
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.domain.Ticket;
/**
* Defines the business logic of the Airline application.
*
* @author Arjen Poutsma
*/
public interface AirlineService {
/**
* Returns a single <code>Flight</code> with the given id.
*
* @param id the flight identifier
* @return the flight
* @throws NoSuchFlightException if a flight with the specified flight iddoes not exist
*/
Flight getFlight(Long id) throws NoSuchFlightException;
/**
* Returns a list of <code>Flight</code> objects that fall within the specified criteria.
*
* @param fromAirportCode the three-letter airport code to get flights from
* @param toAirportCode the three-letter airport code to get flights to
* @param departureDate the date of the flights
* @param serviceClass the desired service class level. May be <code>null</code>
* @return a list of flights
*/
List<Flight> getFlights(String fromAirportCode,
String toAirportCode,
LocalDate departureDate,
ServiceClass serviceClass);
/**
* Books a single flight for a number of passengers. Passengers can be either specified by name or by frequent flyer
* username. If a {@link FrequentFlyer} is specified, the first and last name are looked up in the database.
*
* @param flightNumber the number of the flight to book
* @param departureTime the departure time of the flight to book
* @param passengers the list of passengers for the flight to book. Can be either {@link Passenger} objects with
* a first and last name, or {@link FrequentFlyer} objects with a username.
* @return the created ticket
* @throws NoSuchFlightException if a flight with the specified flight number and departure time does not
* exist
* @throws NoSeatAvailableException if not enough seats are available for the flight
* @throws NoSuchFrequentFlyerException if a specified {@link FrequentFlyer} cannot be found
* @see org.springframework.ws.samples.airline.domain.Passenger
* @see org.springframework.ws.samples.airline.domain.FrequentFlyer
*/
Ticket bookFlight(String flightNumber, DateTime departureTime, List<Passenger> passengers)
throws NoSuchFlightException, NoSeatAvailableException, NoSuchFrequentFlyerException;
/**
* Returns the amount of frequent flyer award miles for the currently logged in frequent flyer.
*
* @return the amount of frequent flyer miles
*/
int getFrequentFlyerMileage();
}

View File

@@ -1,41 +0,0 @@
/*
* Copyright 2006 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.service;
import org.springframework.ws.samples.airline.domain.Flight;
import org.springframework.ws.soap.server.endpoint.annotation.FaultCode;
import org.springframework.ws.soap.server.endpoint.annotation.SoapFault;
/**
* Exception thrown when not enough seats are available for a flight.
*
* @author Arjen Poutsma
*/
@SoapFault(faultCode = FaultCode.SERVER)
public class NoSeatAvailableException extends Exception {
private Flight flight;
public NoSeatAvailableException(Flight flight) {
super("Flight [" + flight + "] has not more seats available");
this.flight = flight;
}
public Flight getFlight() {
return flight;
}
}

View File

@@ -1,52 +0,0 @@
/*
* Copyright 2006 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.service;
import org.joda.time.DateTime;
import org.springframework.ws.soap.server.endpoint.annotation.FaultCode;
import org.springframework.ws.soap.server.endpoint.annotation.SoapFault;
/**
* Exception thrown when a specified flight cannot be found.
*
* @author Arjen Poutsma
*/
@SoapFault(faultCode = FaultCode.CLIENT)
public class NoSuchFlightException extends Exception {
private String flightNumber;
private DateTime departureTime;
public NoSuchFlightException(String flightNumber, DateTime departureTime) {
super("No flight with number [" + flightNumber + "] and departure time [" + departureTime + "]");
this.flightNumber = flightNumber;
this.departureTime = departureTime;
}
public NoSuchFlightException(Long id) {
super("No flight with id [" + id + "]");
}
public String getFlightNumber() {
return flightNumber;
}
public DateTime getDepartureTime() {
return departureTime;
}
}

View File

@@ -1,41 +0,0 @@
/*
* Copyright 2006 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.service;
import org.springframework.ws.soap.server.endpoint.annotation.FaultCode;
import org.springframework.ws.soap.server.endpoint.annotation.SoapFault;
/**
* Exception thrown when a specified frequent flyer cannot be found.
*
* @author Rossen Stoyanchev
* @author Arjen Poutsma
*/
@SoapFault(faultCode = FaultCode.CLIENT)
public class NoSuchFrequentFlyerException extends Exception {
private String username;
public NoSuchFrequentFlyerException(String username) {
super("No frequent flyer with name [" + username + "]");
this.username = username;
}
public String getusername() {
return username;
}
}

View File

@@ -1,146 +0,0 @@
/*
* 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.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.ws.samples.airline.dao.FlightDao;
import org.springframework.ws.samples.airline.dao.TicketDao;
import org.springframework.ws.samples.airline.domain.Flight;
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.domain.Ticket;
import org.springframework.ws.samples.airline.security.FrequentFlyerSecurityService;
import org.springframework.ws.samples.airline.security.StubFrequentFlyerSecurityService;
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.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
/**
* Default implementation of the <code>AirlineService</code> interface.
*
* @author Arjen Poutsma
*/
@Service
@Transactional(readOnly = true)
public class AirlineServiceImpl implements AirlineService {
private static final Log logger = LogFactory.getLog(AirlineServiceImpl.class);
private FlightDao flightDao;
private TicketDao ticketDao;
private FrequentFlyerSecurityService frequentFlyerSecurityService = new StubFrequentFlyerSecurityService();
@Autowired
public AirlineServiceImpl(FlightDao flightDao, TicketDao ticketDao) {
this.flightDao = flightDao;
this.ticketDao = ticketDao;
}
@Autowired(required = false)
public void setFrequentFlyerSecurityService(FrequentFlyerSecurityService frequentFlyerSecurityService) {
this.frequentFlyerSecurityService = frequentFlyerSecurityService;
}
@Transactional(readOnly = false,
rollbackFor = {NoSuchFlightException.class, NoSeatAvailableException.class, NoSuchFrequentFlyerException.class})
public Ticket bookFlight(String flightNumber, DateTime departureTime, List<Passenger> passengers)
throws NoSuchFlightException, NoSeatAvailableException, NoSuchFrequentFlyerException {
Assert.notEmpty(passengers, "No passengers given");
if (logger.isDebugEnabled()) {
logger.debug("Booking flight '" + flightNumber + "' on '" + departureTime + "' for " + passengers);
}
Flight flight = flightDao.getFlight(flightNumber, departureTime);
if (flight == null) {
throw new NoSuchFlightException(flightNumber, departureTime);
}
else if (flight.getSeatsAvailable() < passengers.size()) {
throw new NoSeatAvailableException(flight);
}
Ticket ticket = new Ticket();
ticket.setIssueDate(new LocalDate());
ticket.setFlight(flight);
for (Passenger passenger : passengers) {
// frequent flyer service is not required
if (passenger instanceof FrequentFlyer && frequentFlyerSecurityService != null) {
String username = ((FrequentFlyer) passenger).getUsername();
Assert.hasLength(username, "No username specified");
FrequentFlyer frequentFlyer = frequentFlyerSecurityService.getFrequentFlyer(username);
frequentFlyer.addMiles(flight.getMiles());
ticket.addPassenger(frequentFlyer);
}
else {
ticket.addPassenger(passenger);
}
}
flight.substractSeats(passengers.size());
flightDao.update(flight);
ticketDao.save(ticket);
return ticket;
}
public Flight getFlight(Long id) throws NoSuchFlightException {
Flight flight = flightDao.getFlight(id);
if (flight != null) {
return flight;
}
else {
throw new NoSuchFlightException(id);
}
}
public List<Flight> getFlights(String fromAirportCode,
String toAirportCode,
LocalDate departureDate,
ServiceClass serviceClass) {
if (serviceClass == null) {
serviceClass = ServiceClass.ECONOMY;
}
if (logger.isDebugEnabled()) {
logger.debug(
"Getting flights from '" + fromAirportCode + "' to '" + toAirportCode + "' on " + departureDate);
}
List<Flight> flights =
flightDao.findFlights(fromAirportCode, toAirportCode, departureDate.toInterval(), serviceClass);
if (logger.isDebugEnabled()) {
logger.debug("Returning " + flights.size() + " flights");
}
return flights;
}
@Secured({"ROLE_FREQUENT_FLYER"})
public int getFrequentFlyerMileage() {
if (logger.isDebugEnabled()) {
logger.debug("Using " + frequentFlyerSecurityService + " for security");
}
FrequentFlyer frequentFlyer = frequentFlyerSecurityService.getCurrentlyAuthenticatedFrequentFlyer();
return frequentFlyer != null ? frequentFlyer.getMiles() : 0;
}
}

View File

@@ -1,80 +0,0 @@
/*
* 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.web;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.ws.samples.airline.domain.Flight;
import org.springframework.ws.samples.airline.domain.ServiceClass;
import org.springframework.ws.samples.airline.service.AirlineService;
import org.springframework.ws.samples.airline.service.NoSuchFlightException;
import org.joda.time.LocalDate;
/** @author Arjen Poutsma */
@Controller
@RequestMapping("/flights")
public class FlightsController {
private AirlineService airlineService;
@Autowired
public FlightsController(AirlineService airlineService) {
Assert.notNull(airlineService, "'airlineService' must not be null");
this.airlineService = airlineService;
}
@RequestMapping
public String flightList(@RequestParam(value = "from", required = false)String fromAirportCode,
@RequestParam(value = "to", required = false)String toAirportCode,
@RequestParam(value = "departureDate", required = false)String departureDateString,
@RequestParam(value = "serviceClass", required = false)String serviceClassString,
ModelMap model) {
if (!StringUtils.hasLength(departureDateString)) {
departureDateString = new LocalDate().toString();
}
if (!StringUtils.hasLength(serviceClassString)) {
serviceClassString = "ECONOMY";
}
ServiceClass serviceClass = ServiceClass.valueOf(serviceClassString);
LocalDate departureDate = new LocalDate(departureDateString);
if (StringUtils.hasLength(fromAirportCode) && StringUtils.hasLength(toAirportCode)) {
model.addAttribute("from", fromAirportCode);
model.addAttribute("to", toAirportCode);
model.addAttribute("departureDate", departureDateString);
model.addAttribute("serviceClass", serviceClassString);
model.addAttribute("flights",
airlineService.getFlights(fromAirportCode, toAirportCode, departureDate, serviceClass));
}
return "flights";
}
@RequestMapping(value = "{id}")
public String singleFlight(@PathVariable("id") long id, ModelMap model) throws NoSuchFlightException {
Flight flight = airlineService.getFlight(id);
model.addAttribute(flight);
return "flight";
}
}

View File

@@ -1,179 +0,0 @@
/*
* 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 javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
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 org.w3c.dom.Document;
import org.w3c.dom.Element;
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 DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
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
* <code>&lt;GetFlightsRequest&gt;</code> 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 <code>&lt;GetFlightsResponse&gt;</code>
*/
@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<org.springframework.ws.samples.airline.domain.Flight> 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 <code>&lt;BookFlightRequest&gt;</code> payload.
*
* @param request the JAXB2 representation of a <code>&lt;BookFlightRequest&gt;</code>
* @return the JAXB2 representation of a <code>&lt;BookFlightResponse&gt;</code>
*/
@PayloadRoot(localPart = BOOK_FLIGHT_REQUEST, namespace = MESSAGES_NAMESPACE)
@ResponsePayload
public JAXBElement<Ticket> 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<Object> passengerOrUsernameList)
throws NoSeatAvailableException, NoSuchFlightException, NoSuchFrequentFlyerException,
DatatypeConfigurationException {
DateTime departureTime = SchemaConversionUtils.toDateTime(xmlDepartureTime);
List<Passenger> passengers = new ArrayList<Passenger>(passengerOrUsernameList.size());
for (Iterator<Object> iterator = passengerOrUsernameList.iterator(); iterator.hasNext();) {
Object passengerOrUsername = iterator.next();
if (passengerOrUsername instanceof Name) {
Name passengerName = (Name) passengerOrUsername;
Passenger passenger = new Passenger(passengerName.getFirst(), passengerName.getLast());
passengers.add(passenger);
}
else if (passengerOrUsername instanceof String) {
String frequentFlyerUsername = (String) passengerOrUsername;
FrequentFlyer frequentFlyer = new FrequentFlyer(frequentFlyerUsername);
passengers.add(frequentFlyer);
}
}
org.springframework.ws.samples.airline.domain.Ticket domainTicket =
airlineService.bookFlight(flightNumber, departureTime, passengers);
return SchemaConversionUtils.toSchemaType(domainTicket);
}
@PayloadRoot(localPart = GET_FREQUENT_FLYER_MILEAGE_REQUEST, namespace = MESSAGES_NAMESPACE)
@ResponsePayload
public Element getFrequentFlyerMileage() throws Exception {
if (logger.isDebugEnabled()) {
logger.debug("Received GetFrequentFlyerMileageRequest");
}
int mileage = airlineService.getFrequentFlyerMileage();
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
Document document = documentBuilder.newDocument();
Element response = document.createElementNS(MESSAGES_NAMESPACE, GET_FREQUENT_FLYER_MILEAGE_RESPONSE);
response.setTextContent(Integer.toString(mileage));
return response;
}
}

View File

@@ -1,31 +0,0 @@
/*
* Copyright 2007 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;
/** @author Arjen Poutsma */
public interface AirlineWebServiceConstants {
String BOOK_FLIGHT_REQUEST = "BookFlightRequest";
String GET_FLIGHTS_REQUEST = "GetFlightsRequest";
String GET_FREQUENT_FLYER_MILEAGE_RESPONSE = "GetFrequentFlyerMileageResponse";
String MESSAGES_NAMESPACE = "http://www.springframework.org/spring-ws/samples/airline/schemas/messages";
String GET_FREQUENT_FLYER_MILEAGE_REQUEST = "GetFrequentFlyerMileageRequest";
}

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="airline">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<class>org.springframework.ws.samples.airline.domain.Airport</class>
<class>org.springframework.ws.samples.airline.domain.Flight</class>
<class>org.springframework.ws.samples.airline.domain.FrequentFlyer</class>
<class>org.springframework.ws.samples.airline.domain.Passenger</class>
<class>org.springframework.ws.samples.airline.domain.Ticket</class>
</persistence-unit>
</persistence>

View File

@@ -1,8 +0,0 @@
log4j.rootLogger=WARN, stdout
log4j.logger.org.springframework.ws=DEBUG
log4j.logger.org.springframework.xml=DEBUG
log4j.logger.openjpa=INFO
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n

View File

@@ -1,42 +0,0 @@
<?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:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<context:component-scan base-package="org.springframework.ws.samples.airline.dao.jpa"/>
<context:annotation-config/>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="airline"/>
<property name="dataSource" ref="dataSource"/>
<property name="jpaDialect">
<bean class="org.springframework.orm.jpa.vendor.OpenJpaDialect"/>
</property>
<property name="jpaProperties">
<props>
<prop key="openjpa.Log">commons</prop>
<prop key="openjpa.jdbc.SynchronizeMappings">buildSchema</prop>
<prop key="openjpa.jdbc.MappingDefaults">
FieldStrategies='org.joda.time.DateTime=org.springframework.ws.samples.airline.domain.openjpa.DateTimeValueHandler,
org.joda.time.LocalDate=org.springframework.ws.samples.airline.domain.openjpa.LocalDateValueHandler'
</prop>
<prop key="openjpa.jdbc.DBDictionary">org.apache.openjpa.jdbc.sql.HSQLDictionary</prop>
</props>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
<property name="url" value="jdbc:hsqldb:mem:airline"/>
<property name="username" value="sa"/>
<property name="password" value=""/>
</bean>
</beans>

View File

@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:jms="http://www.springframework.org/schema/jms"
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-3.1.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.1.xsd">
<!-- ===================== JMS TRANSPORT ===================================== -->
<bean id="broker" class="org.apache.activemq.broker.BrokerFactory" factory-method="createBroker"
init-method="start">
<constructor-arg value="broker:tcp://localhost:61616?persistent=false"/>
</bean>
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616"/>
</bean>
<jms:listener-container connection-factory="connectionFactory">
<jms:listener destination="RequestQueue" ref="messageListener"/>
</jms:listener-container>
<bean id="messageListener" class="org.springframework.ws.transport.jms.WebServiceMessageListener">
<property name="messageFactory" ref="messageFactory"/>
<property name="messageReceiver" ref="messageReceiver"/>
</bean>
</beans>

View File

@@ -1,26 +0,0 @@
<?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:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">
<description>
This application context contains the WS-Security and Spring Security beans.
</description>
<security:global-method-security secured-annotations="enabled"/>
<security:authentication-manager>
<security:authentication-provider user-service-ref="securityService"/>
</security:authentication-manager>
<bean id="securityService"
class="org.springframework.ws.samples.airline.security.SpringFrequentFlyerSecurityService">
<description>
A security service used to obtain Frequent Flyer information.
</description>
</bean>
</beans>

View File

@@ -1,3 +0,0 @@
<xwss:SecurityConfiguration dumpMessages="false" xmlns:xwss="http://java.sun.com/xml/ns/xwss/config">
<xwss:RequireUsernameToken passwordDigestRequired="true" nonceRequired="true"/>
</xwss:SecurityConfiguration>

View File

@@ -1,16 +0,0 @@
<?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:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<tx:annotation-driven/>
<context:annotation-config/>
<context:component-scan base-package="org.springframework.ws.samples.airline.service"/>
</beans>

View File

@@ -1,47 +0,0 @@
<?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:context="http://www.springframework.org/schema/context"
xmlns:sws="http://www.springframework.org/schema/web-services"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd">
<sws:annotation-driven />
<sws:interceptors>
<bean class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor"/>
<bean class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
<property name="xsdSchemaCollection" ref="schemaCollection"/>
<property name="validateRequest" value="true"/>
<property name="validateResponse" value="true"/>
</bean>
<sws:payloadRoot localPart="GetFrequentFlyerMileageRequest" namespaceUri="http://www.springframework.org/spring-ws/samples/airline/schemas/messages">
<bean class="org.springframework.ws.soap.security.xwss.XwsSecurityInterceptor">
<property name="secureResponse" value="false"/>
<property name="policyConfiguration"
value="classpath:org/springframework/ws/samples/airline/security/securityPolicy.xml"/>
<property name="callbackHandler">
<bean class="org.springframework.ws.soap.security.xwss.callback.SpringDigestPasswordValidationCallbackHandler">
<property name="userDetailsService" ref="securityService"/>
</bean>
</property>
</bean>
</sws:payloadRoot>
</sws:interceptors>
<context:component-scan base-package="org.springframework.ws.samples.airline.ws"/>
<bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory"/>
<bean id="messageReceiver" class="org.springframework.ws.soap.server.SoapMessageDispatcher"/>
<bean id="schemaCollection" class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">
<description>
This bean wrap the messages.xsd (which imports types.xsd), and inlines them as a one.
</description>
<property name="xsds" value="/messages.xsd"/>
<property name="inline" value="true"/>
</bean>
</beans>

View File

@@ -1,13 +0,0 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<%
Exception ex = (Exception) request.getAttribute("exception");
%>
<head><title><%= ex.getMessage() %>
</title></head>
<body>
<h2><%= ex.getMessage() %>
</h2>
<a href='<c:url value="/flights"/>'>Flights</a>
</body>
</html>

View File

@@ -1,47 +0,0 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="joda" uri="http://www.joda.org/joda/time/tags" %>
<html>
<head><title>Flights</title></head>
<body>
<table>
<tr>
<td>Number:</td>
<td>
<c:out value="${flight.number}"/>
</td>
</tr>
<tr>
<td>From:</td>
<td>
<c:out value="${flight.from.city}"/>
(
<c:out value="${flight.from.code}"/>
)
</td>
</tr>
<tr>
<td>Departure:</td>
<td>
<joda:format value="${flight.departureTime}" style="MM"/>
</td>
</tr>
<tr>
<td>To:</td>
<td>
<c:out value="${flight.to.city}"/>
(
<c:out value="${flight.to.code}"/>
)
</td>
</tr>
<tr>
<td>Departure:</td>
<td>
<joda:format value="${flight.arrivalTime}" style="MM"/>
</td>
</tr>
</table>
<a href='<c:url value="/flights.html"/>'>Flights</a>
</body>
</html>

View File

@@ -1,73 +0,0 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="joda" uri="http://www.joda.org/joda/time/tags" %>
<html>
<head><title>Flights</title></head>
<body>
<form a method="get" action='<c:url value="/flights.html"/>'>
<table>
<tr>
<td>From:</td>
<td><input name="from" value='<c:out value="${from}" default="AMS"/>'/></td>
</tr>
<tr>
<td>To:</td>
<td><input name="to" value="<c:out value="${to}" default="VCE"/>"/></td>
</tr>
<tr>
<td>Departure Date:</td>
<td><input name="departureDate" value="<c:out value="${departureDate}" default="2006-01-31"/>"/></td>
</tr>
<tr>
<td>Service Class:</td>
<td>
<select name="serviceClass">
<option value="ECONOMY" selected="selected">Economy</option>
<option value="BUSINESS">Business</option>
<option value="FIRST">First</option>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="Submit"/>
</td>
</tr>
</table>
<c:if test="${!empty flights}">
<table border="1px">
<tr>
<th>Number</th>
<th>Departs</th>
<th>Arrives</th>
</tr>
<c:forEach var="flight" items="${flights}">
<tr>
<td>
<spring:url var="flightUrl" value="flights/{id}.html">
<spring:param name="id" value="${flight.id}"/>
</spring:url>
<a href='<c:out value="${flightUrl}"/>'><c:out value="${flight.number}"/></a>
</td>
<td>
<c:out value="${flight.from.city}"/>
(
<c:out value="${flight.from.code}"/>
)
<joda:format value="${flight.departureTime}" style="SS"/>
</td>
<td>
<c:out value="${flight.to.city}"/>
(
<c:out value="${flight.to.code}"/>
)
<joda:format value="${flight.arrivalTime}" style="SS"/>
</td>
</tr>
</c:forEach>
</table>
</c:if>
</form>
</body>
</html>

View File

@@ -1,13 +0,0 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head><title>No Such Flight</title></head>
<body>
<%
Exception ex = (Exception) request.getAttribute("exception");
%>
<h2>No such flight: <%= ex.getMessage() %>
</h2>
<a href='<c:url value="/flights"/>'>Flights</a>
</body>
</html>

View File

@@ -1,33 +0,0 @@
<?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:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<description>
This web application context contains a simple Spring Web MVC web application that shows flights
</description>
<context:component-scan base-package="org.springframework.ws.samples.airline.web"/>
<!-- ===================== HANDLERS ===================================== -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
<bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
<property name="defaultErrorView" value="error"/>
<property name="exceptionMappings">
<props>
<prop key="org.springframework.ws.samples.airline.service.NoSuchFlightException">noSuchFlight</prop>
</props>
</property>
</bean>
</beans>

View File

@@ -1,48 +0,0 @@
<?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">
<display-name>Spring-WS Airline Sample</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:org/springframework/ws/samples/airline/dao/jpa/applicationContext-jpa.xml
classpath:org/springframework/ws/samples/airline/service/applicationContext.xml
classpath:org/springframework/ws/samples/airline/security/applicationContext-security.xml
classpath:org/springframework/ws/samples/airline/ws/applicationContext-ws.xml
classpath:org/springframework/ws/samples/airline/jms/applicationContext-jms.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>ws</servlet-name>
<servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ws</servlet-name>
<url-pattern>/services</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ws</servlet-name>
<url-pattern>*.wsdl</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>mvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>mvc</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<mime-mapping>
<extension>xsd</extension>
<mime-type>text/xml</mime-type>
</mime-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<!-- ===================== WSDL DEFINITION ============================== -->
<bean id="airline" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
<description>
Builds a WSDL from the airline.xsd.This bean definition represents the airline.wsdl file found
in the root of the web application.
</description>
<property name="schemaCollection" ref="schemaCollection"/>
<property name="portTypeName" value="Airline"/>
<property name="locationUri" value="http://localhost:8080/airline-server/services"/>
<property name="targetNamespace"
value="http://www.springframework.org/spring-ws/samples/airline/definitions"/>
</bean>
</beans>

View File

@@ -1,3 +0,0 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:redirect url="/flights.html"/>

View File

@@ -1,52 +0,0 @@
<?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:tns="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>

View File

@@ -1,74 +0,0 @@
<?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/types"
xmlns:tns="http://www.springframework.org/spring-ws/samples/airline/schemas/types"
elementFormDefault="qualified">
<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 name="passenger" type="tns:Name" maxOccurs="9"/>
</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>

Some files were not shown because too many files have changed in this diff Show More