Skip to content

Commit 0b7836b

Browse files
committed
Merge in starter and sample for Spring Web Services
Closes #1055
2 parents b5d267c + b585afe commit 0b7836b

File tree

17 files changed

+537
-24
lines changed

17 files changed

+537
-24
lines changed

pom.xml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
34
<modelVersion>4.0.0</modelVersion>
45
<groupId>org.springframework.boot</groupId>
56
<artifactId>spring-boot-build</artifactId>
@@ -148,20 +149,20 @@
148149
<inherited>false</inherited>
149150
<configuration>
150151
<target>
151-
<taskdef resource="net/sf/antcontrib/antcontrib.properties" />
152-
<taskdef name="stringutil" classname="ise.antelope.tasks.StringUtilTask" />
153-
<var name="version-type" value="${project.version}" />
154-
<propertyregex property="version-type" override="true" input="${version-type}" regexp=".*\.(.*)" replace="\1" />
155-
<propertyregex property="version-type" override="true" input="${version-type}" regexp="(M)\d+" replace="MILESTONE" />
156-
<propertyregex property="version-type" override="true" input="${version-type}" regexp="(RC)\d+" replace="MILESTONE" />
157-
<propertyregex property="version-type" override="true" input="${version-type}" regexp="BUILD-(.*)" replace="SNAPSHOT" />
152+
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
153+
<taskdef name="stringutil" classname="ise.antelope.tasks.StringUtilTask"/>
154+
<var name="version-type" value="${project.version}"/>
155+
<propertyregex property="version-type" override="true" input="${version-type}" regexp=".*\.(.*)" replace="\1"/>
156+
<propertyregex property="version-type" override="true" input="${version-type}" regexp="(M)\d+" replace="MILESTONE"/>
157+
<propertyregex property="version-type" override="true" input="${version-type}" regexp="(RC)\d+" replace="MILESTONE"/>
158+
<propertyregex property="version-type" override="true" input="${version-type}" regexp="BUILD-(.*)" replace="SNAPSHOT"/>
158159
<stringutil string="${version-type}" property="profile">
159-
<lowercase />
160+
<lowercase/>
160161
</stringutil>
161-
<echo message="Writing settings for ${profile} profile" />
162+
<echo message="Writing settings for ${profile} profile"/>
162163
<copy file=".settings-template.xml" tofile="settings.xml" overwrite="true">
163164
<filterset>
164-
<filter token="profile" value="${profile}" />
165+
<filter token="profile" value="${profile}"/>
165166
</filterset>
166167
</copy>
167168
</target>
@@ -176,7 +177,7 @@
176177
<inherited>false</inherited>
177178
<configuration>
178179
<target>
179-
<property name="sourceFile" value="spring-boot-dependencies/pom.xml" />
180+
<property name="sourceFile" value="spring-boot-dependencies/pom.xml"/>
180181
<xslt in="${sourceFile}" out="${sourceFile}.new" force="true">
181182
<style>
182183
<string><![CDATA[
@@ -199,9 +200,9 @@
199200
</string>
200201
</style>
201202
</xslt>
202-
<move file="${sourceFile}" tofile="${sourceFile}.old" />
203-
<move file="${sourceFile}.new" tofile="${sourceFile}" />
204-
<delete file="${sourceFile}.old" />
203+
<move file="${sourceFile}" tofile="${sourceFile}.old"/>
204+
<move file="${sourceFile}.new" tofile="${sourceFile}"/>
205+
<delete file="${sourceFile}.old"/>
205206
</target>
206207
</configuration>
207208
</execution>

spring-boot-dependencies/pom.xml

Lines changed: 76 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
<jedis.version>2.4.1</jedis.version>
8080
<jetty.version>8.1.15.v20140411</jetty.version>
8181
<jetty-jsp.version>2.2.0.v201112011158</jetty-jsp.version>
82+
<jaxen.version>1.1.6</jaxen.version>
83+
<jdom2.version>2.0.5</jdom2.version>
8284
<joda-time.version>2.3</joda-time.version>
8385
<jolokia.version>1.2.1</jolokia.version>
8486
<jstl.version>1.2</jstl.version>
@@ -109,12 +111,14 @@
109111
<spring-social-linkedin.version>1.0.1.RELEASE</spring-social-linkedin.version>
110112
<spring-security.version>3.2.4.RELEASE</spring-security.version>
111113
<spring-security-jwt.version>1.0.2.RELEASE</spring-security-jwt.version>
114+
<spring-ws.version>2.2.0.RELEASE</spring-ws.version>
112115
<thymeleaf.version>2.1.3.RELEASE</thymeleaf.version>
113116
<thymeleaf-extras-springsecurity3.version>2.1.1.RELEASE</thymeleaf-extras-springsecurity3.version>
114117
<thymeleaf-layout-dialect.version>1.2.4</thymeleaf-layout-dialect.version>
115118
<tomcat.version>7.0.54</tomcat.version>
116119
<velocity.version>1.7</velocity.version>
117120
<velocity-tools.version>2.0</velocity-tools.version>
121+
<wsdl4j.version>1.6.1</wsdl4j.version>
118122
</properties>
119123
<prerequisites>
120124
<maven>3.0.0</maven>
@@ -330,6 +334,11 @@
330334
<artifactId>spring-boot-starter-websocket</artifactId>
331335
<version>1.1.0.BUILD-SNAPSHOT</version>
332336
</dependency>
337+
<dependency>
338+
<groupId>org.springframework.boot</groupId>
339+
<artifactId>spring-boot-starter-ws</artifactId>
340+
<version>1.1.0.BUILD-SNAPSHOT</version>
341+
</dependency>
333342

334343
<!-- Third Party -->
335344
<dependency>
@@ -454,6 +463,11 @@
454463
<artifactId>jstl</artifactId>
455464
<version>${jstl.version}</version>
456465
</dependency>
466+
<dependency>
467+
<groupId>jaxen</groupId>
468+
<artifactId>jaxen</artifactId>
469+
<version>${jaxen.version}</version>
470+
</dependency>
457471
<dependency>
458472
<groupId>joda-time</groupId>
459473
<artifactId>joda-time</artifactId>
@@ -819,6 +833,11 @@
819833
<artifactId>jolokia-core</artifactId>
820834
<version>${jolokia.version}</version>
821835
</dependency>
836+
<dependency>
837+
<groupId>org.jdom</groupId>
838+
<artifactId>jdom2</artifactId>
839+
<version>${jdom2.version}</version>
840+
</dependency>
822841
<dependency>
823842
<groupId>org.liquibase</groupId>
824843
<artifactId>liquibase-core</artifactId>
@@ -1058,31 +1077,75 @@
10581077
<artifactId>spring-social-facebook-web</artifactId>
10591078
<version>${spring-social-facebook.version}</version>
10601079
</dependency>
1080+
<dependency>
1081+
<groupId>org.springframework.social</groupId>
1082+
<artifactId>spring-social-linkedin</artifactId>
1083+
<version>${spring-social-linkedin.version}</version>
1084+
</dependency>
10611085
<dependency>
10621086
<groupId>org.springframework.social</groupId>
10631087
<artifactId>spring-social-twitter</artifactId>
10641088
<version>${spring-social-twitter.version}</version>
10651089
</dependency>
10661090
<dependency>
1067-
<groupId>org.springframework.social</groupId>
1068-
<artifactId>spring-social-linkedin</artifactId>
1069-
<version>${spring-social-linkedin.version}</version>
1091+
<groupId>org.springframework.ws</groupId>
1092+
<artifactId>spring-ws-core</artifactId>
1093+
<version>${spring-ws.version}</version>
1094+
<exclusions>
1095+
<exclusion>
1096+
<groupId>commons-logging</groupId>
1097+
<artifactId>commons-logging</artifactId>
1098+
</exclusion>
1099+
</exclusions>
1100+
</dependency>
1101+
<dependency>
1102+
<groupId>org.springframework.ws</groupId>
1103+
<artifactId>spring-ws-support</artifactId>
1104+
<version>${spring-ws.version}</version>
1105+
<exclusions>
1106+
<exclusion>
1107+
<groupId>commons-logging</groupId>
1108+
<artifactId>commons-logging</artifactId>
1109+
</exclusion>
1110+
</exclusions>
1111+
</dependency>
1112+
<dependency>
1113+
<groupId>org.springframework.ws</groupId>
1114+
<artifactId>spring-ws-security</artifactId>
1115+
<version>${spring-ws.version}</version>
1116+
<exclusions>
1117+
<exclusion>
1118+
<groupId>commons-logging</groupId>
1119+
<artifactId>commons-logging</artifactId>
1120+
</exclusion>
1121+
</exclusions>
1122+
</dependency>
1123+
<dependency>
1124+
<groupId>org.springframework.ws</groupId>
1125+
<artifactId>spring-ws-test</artifactId>
1126+
<version>${spring-ws.version}</version>
1127+
<exclusions>
1128+
<exclusion>
1129+
<groupId>commons-logging</groupId>
1130+
<artifactId>commons-logging</artifactId>
1131+
</exclusion>
1132+
</exclusions>
10701133
</dependency>
10711134
<dependency>
10721135
<groupId>org.thymeleaf</groupId>
10731136
<artifactId>thymeleaf</artifactId>
10741137
<version>${thymeleaf.version}</version>
10751138
</dependency>
1076-
<dependency>
1077-
<groupId>org.thymeleaf.extras</groupId>
1078-
<artifactId>thymeleaf-extras-springsecurity3</artifactId>
1079-
<version>${thymeleaf-extras-springsecurity3.version}</version>
1080-
</dependency>
10811139
<dependency>
10821140
<groupId>org.thymeleaf</groupId>
10831141
<artifactId>thymeleaf-spring4</artifactId>
10841142
<version>${thymeleaf.version}</version>
10851143
</dependency>
1144+
<dependency>
1145+
<groupId>org.thymeleaf.extras</groupId>
1146+
<artifactId>thymeleaf-extras-springsecurity3</artifactId>
1147+
<version>${thymeleaf-extras-springsecurity3.version}</version>
1148+
</dependency>
10861149
<dependency>
10871150
<groupId>org.yaml</groupId>
10881151
<artifactId>snakeyaml</artifactId>
@@ -1093,6 +1156,11 @@
10931156
<artifactId>jedis</artifactId>
10941157
<version>${jedis.version}</version>
10951158
</dependency>
1159+
<dependency>
1160+
<groupId>wsdl4j</groupId>
1161+
<artifactId>wsdl4j</artifactId>
1162+
<version>${wsdl4j.version}</version>
1163+
</dependency>
10961164
</dependencies>
10971165
</dependencyManagement>
10981166
<build>

spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ and Hibernate.
289289
|Support for websocket development with Tomcat.
290290
|===
291291

292+
|`spring-boot-starter-ws`
293+
|Support for Spring Web Services
294+
|===
295+
292296
In addition to the application starters, the following starters can be used to
293297
add '<<production-ready-features.adoc#production-ready, production ready>>' features.
294298

spring-boot-samples/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@
5656
<module>spring-boot-sample-web-ui</module>
5757
<module>spring-boot-sample-web-velocity</module>
5858
<module>spring-boot-sample-websocket</module>
59+
<module>spring-boot-sample-ws</module>
5960
<module>spring-boot-sample-xml</module>
60-
</modules>
61+
</modules>
6162
<!-- No dependencies - otherwise the samples won't work if you change the
6263
parent -->
6364
<build>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
== Spring Boot - Samples - Web Services
2+
3+
This sample project demonstrates how to use http://projects.spring.io/spring-ws/[Spring Web Services]
4+
with Spring Boot. It is an implementation of the
5+
http://docs.spring.io/spring-ws/site/reference/html/tutorial.html#tutorial.implementing.endpoint[Holiday Request sample]
6+
in the Spring Web Services reference guilde.
7+
8+
The sample uses Maven. It can be built and run from the command line:
9+
10+
----
11+
$ mvn spring-boot:run
12+
----
13+
14+
http://localhost:8080/services/holidayService/holiday.wsdl will now display the generated WSDL.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<!-- Your own application should inherit from spring-boot-starter-parent -->
6+
<artifactId>spring-boot-samples</artifactId>
7+
<groupId>org.springframework.boot</groupId>
8+
<version>1.1.0.BUILD-SNAPSHOT</version>
9+
</parent>
10+
<artifactId>spring-boot-sample-ws</artifactId>
11+
<name>Spring Boot Web Services Sample</name>
12+
<description>Spring Boot Web Services Sample</description>
13+
<url>http://projects.spring.io/spring-boot/</url>
14+
<organization>
15+
<name>Pivotal Software, Inc.</name>
16+
<url>http://www.spring.io</url>
17+
</organization>
18+
<properties>
19+
<main.basedir>${basedir}/../..</main.basedir>
20+
</properties>
21+
<dependencies>
22+
<dependency>
23+
<groupId>org.springframework.boot</groupId>
24+
<artifactId>spring-boot-starter-test</artifactId>
25+
<scope>test</scope>
26+
</dependency>
27+
<dependency>
28+
<groupId>org.springframework.boot</groupId>
29+
<artifactId>spring-boot-starter-ws</artifactId>
30+
</dependency>
31+
<dependency>
32+
<groupId>jaxen</groupId>
33+
<artifactId>jaxen</artifactId>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.jdom</groupId>
37+
<artifactId>jdom2</artifactId>
38+
</dependency>
39+
<dependency>
40+
<groupId>wsdl4j</groupId>
41+
<artifactId>wsdl4j</artifactId>
42+
</dependency>
43+
</dependencies>
44+
<build>
45+
<plugins>
46+
<plugin>
47+
<groupId>org.springframework.boot</groupId>
48+
<artifactId>spring-boot-maven-plugin</artifactId>
49+
</plugin>
50+
</plugins>
51+
</build>
52+
</project>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright 2012-2014 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package sample.ws;
17+
18+
import org.springframework.boot.SpringApplication;
19+
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
20+
import org.springframework.context.annotation.ComponentScan;
21+
import org.springframework.context.annotation.Configuration;
22+
23+
@Configuration
24+
@EnableAutoConfiguration
25+
@ComponentScan
26+
public class SampleWsApplication {
27+
28+
public static void main(String[] args) throws Exception {
29+
SpringApplication.run(SampleWsApplication.class, args);
30+
}
31+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright 2012-2014 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package sample.ws;
17+
18+
import org.springframework.boot.context.embedded.ServletRegistrationBean;
19+
import org.springframework.context.ApplicationContext;
20+
import org.springframework.context.annotation.Bean;
21+
import org.springframework.context.annotation.Configuration;
22+
import org.springframework.core.io.ClassPathResource;
23+
import org.springframework.ws.config.annotation.EnableWs;
24+
import org.springframework.ws.config.annotation.WsConfigurerAdapter;
25+
import org.springframework.ws.transport.http.MessageDispatcherServlet;
26+
import org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition;
27+
import org.springframework.xml.xsd.SimpleXsdSchema;
28+
import org.springframework.xml.xsd.XsdSchema;
29+
30+
@EnableWs
31+
@Configuration
32+
public class WebServiceConfig extends WsConfigurerAdapter {
33+
34+
@Bean
35+
public ServletRegistrationBean dispatcherServlet(ApplicationContext applicationContext) {
36+
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
37+
servlet.setApplicationContext(applicationContext);
38+
return new ServletRegistrationBean(servlet, "/services/*");
39+
}
40+
41+
@Bean(name = "holiday")
42+
public DefaultWsdl11Definition defaultWsdl11Definition(XsdSchema countriesSchema) {
43+
DefaultWsdl11Definition wsdl11Definition = new DefaultWsdl11Definition();
44+
wsdl11Definition.setPortTypeName("HumanResource");
45+
wsdl11Definition.setLocationUri("/holidayService/");
46+
wsdl11Definition.setTargetNamespace("http://mycompany.com/hr/definitions");
47+
wsdl11Definition.setSchema(countriesSchema);
48+
return wsdl11Definition;
49+
}
50+
51+
@Bean
52+
public XsdSchema countriesSchema() {
53+
return new SimpleXsdSchema(new ClassPathResource("META-INF/schemas/hr.xsd"));
54+
}
55+
}

0 commit comments

Comments
 (0)