Polishing

This commit is contained in:
Andy Wilkinson 2014-06-09 18:03:22 +01:00
parent e40320a8ed
commit b585afe537
16 changed files with 247 additions and 158 deletions

View File

@ -80,7 +80,7 @@
<jetty.version>8.1.15.v20140411</jetty.version> <jetty.version>8.1.15.v20140411</jetty.version>
<jetty-jsp.version>2.2.0.v201112011158</jetty-jsp.version> <jetty-jsp.version>2.2.0.v201112011158</jetty-jsp.version>
<jaxen.version>1.1.6</jaxen.version> <jaxen.version>1.1.6</jaxen.version>
<jdom.version>2.0.1</jdom.version> <jdom2.version>2.0.5</jdom2.version>
<joda-time.version>2.3</joda-time.version> <joda-time.version>2.3</joda-time.version>
<jolokia.version>1.2.1</jolokia.version> <jolokia.version>1.2.1</jolokia.version>
<jstl.version>1.2</jstl.version> <jstl.version>1.2</jstl.version>
@ -118,6 +118,7 @@
<tomcat.version>7.0.54</tomcat.version> <tomcat.version>7.0.54</tomcat.version>
<velocity.version>1.7</velocity.version> <velocity.version>1.7</velocity.version>
<velocity-tools.version>2.0</velocity-tools.version> <velocity-tools.version>2.0</velocity-tools.version>
<wsdl4j.version>1.6.1</wsdl4j.version>
</properties> </properties>
<prerequisites> <prerequisites>
<maven>3.0.0</maven> <maven>3.0.0</maven>
@ -834,8 +835,8 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jdom</groupId> <groupId>org.jdom</groupId>
<artifactId>jdom</artifactId> <artifactId>jdom2</artifactId>
<version>${jdom.version}</version> <version>${jdom2.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.liquibase</groupId> <groupId>org.liquibase</groupId>
@ -1066,6 +1067,26 @@
<artifactId>spring-social-web</artifactId> <artifactId>spring-social-web</artifactId>
<version>${spring-social.version}</version> <version>${spring-social.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-facebook</artifactId>
<version>${spring-social-facebook.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-facebook-web</artifactId>
<version>${spring-social-facebook.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-linkedin</artifactId>
<version>${spring-social-linkedin.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-twitter</artifactId>
<version>${spring-social-twitter.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.ws</groupId> <groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId> <artifactId>spring-ws-core</artifactId>
@ -1110,16 +1131,6 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
<version>1.6.3</version>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<version>1.5</version>
</dependency>
<dependency> <dependency>
<groupId>org.thymeleaf</groupId> <groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId> <artifactId>thymeleaf</artifactId>
@ -1135,26 +1146,6 @@
<artifactId>thymeleaf-extras-springsecurity3</artifactId> <artifactId>thymeleaf-extras-springsecurity3</artifactId>
<version>${thymeleaf-extras-springsecurity3.version}</version> <version>${thymeleaf-extras-springsecurity3.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-facebook</artifactId>
<version>${spring-social-facebook.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-facebook-web</artifactId>
<version>${spring-social-facebook.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-twitter</artifactId>
<version>${spring-social-twitter.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-linkedin</artifactId>
<version>${spring-social-linkedin.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.yaml</groupId> <groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId> <artifactId>snakeyaml</artifactId>
@ -1165,6 +1156,11 @@
<artifactId>jedis</artifactId> <artifactId>jedis</artifactId>
<version>${jedis.version}</version> <version>${jedis.version}</version>
</dependency> </dependency>
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
<version>${wsdl4j.version}</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<build> <build>

View File

@ -289,6 +289,10 @@ and Hibernate.
|Support for websocket development with Tomcat. |Support for websocket development with Tomcat.
|=== |===
|`spring-boot-starter-ws`
|Support for Spring Web Services
|===
In addition to the application starters, the following starters can be used to In addition to the application starters, the following starters can be used to
add '<<production-ready-features.adoc#production-ready, production ready>>' features. add '<<production-ready-features.adoc#production-ready, production ready>>' features.

View File

@ -56,8 +56,8 @@
<module>spring-boot-sample-web-ui</module> <module>spring-boot-sample-web-ui</module>
<module>spring-boot-sample-web-velocity</module> <module>spring-boot-sample-web-velocity</module>
<module>spring-boot-sample-websocket</module> <module>spring-boot-sample-websocket</module>
<module>spring-boot-sample-ws</module>
<module>spring-boot-sample-xml</module> <module>spring-boot-sample-xml</module>
<module>spring-boot-sample-ws</module>
</modules> </modules>
<!-- No dependencies - otherwise the samples won't work if you change the <!-- No dependencies - otherwise the samples won't work if you change the
parent --> parent -->

View File

@ -0,0 +1,14 @@
== Spring Boot - Samples - Web Services
This sample project demonstrates how to use http://projects.spring.io/spring-ws/[Spring Web Services]
with Spring Boot. It is an implementation of the
http://docs.spring.io/spring-ws/site/reference/html/tutorial.html#tutorial.implementing.endpoint[Holiday Request sample]
in the Spring Web Services reference guilde.
The sample uses Maven. It can be built and run from the command line:
----
$ mvn spring-boot:run
----
http://localhost:8080/services/holidayService/holiday.wsdl will now display the generated WSDL.

View File

@ -1,14 +0,0 @@
# Spring Boot - Samples - Web Services
This sample project demonstrates how to bootstrap and use Spring Web Services with Spring Boot.
It is a runnable implementation of the HolidayRequest sample in the Spring Web Services [reference guide](http://docs.spring.io/spring-ws/site/reference/html/tutorial.html#tutorial.implementing.endpoint).
The sample can be build with Maven (>3) and simply run from the command line.
```
$ mvn package
$ java -jar target/*.jar
```
Now pointing your browser to [http://localhost:8080/services/holidayService/holiday.wsdl] should display the generated WSDL.

View File

@ -1,45 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.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/xsd/maven-4.0.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <modelVersion>4.0.0</modelVersion>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<!-- Your own application should inherit from spring-boot-starter-parent -->
<artifactId>spring-boot-samples</artifactId> <artifactId>spring-boot-samples</artifactId>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<version>1.1.0.BUILD-SNAPSHOT</version> <version>1.1.0.BUILD-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-boot-sample-ws</artifactId> <artifactId>spring-boot-sample-ws</artifactId>
<name>Spring Boot Web Services Sample</name>
<description>Spring Boot Web Services Sample</description>
<url>http://projects.spring.io/spring-boot/</url>
<organization>
<name>Pivotal Software, Inc.</name>
<url>http://www.spring.io</url>
</organization>
<properties> <properties>
<main.basedir>${basedir}/../..</main.basedir> <main.basedir>${basedir}/../..</main.basedir>
<java.version>1.7</java.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-ws</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId> <artifactId>spring-boot-starter-ws</artifactId>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>jaxen</groupId> <groupId>jaxen</groupId>
<artifactId>jaxen</artifactId> <artifactId>jaxen</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>wsdl4j</groupId> <groupId>org.jdom</groupId>
<artifactId>wsdl4j</artifactId> <artifactId>jdom2</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>wsdl4j</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>wsdl4j</artifactId>
<scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -1,3 +1,18 @@
/*
* Copyright 2012-2014 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 sample.ws; package sample.ws;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
@ -5,9 +20,6 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
/**
* Created by in329dei on 28-2-14.
*/
@Configuration @Configuration
@EnableAutoConfiguration @EnableAutoConfiguration
@ComponentScan @ComponentScan

View File

@ -1,3 +1,18 @@
/*
* Copyright 2012-2014 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 sample.ws; package sample.ws;
import org.springframework.boot.context.embedded.ServletRegistrationBean; import org.springframework.boot.context.embedded.ServletRegistrationBean;
@ -12,19 +27,14 @@ import org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition;
import org.springframework.xml.xsd.SimpleXsdSchema; import org.springframework.xml.xsd.SimpleXsdSchema;
import org.springframework.xml.xsd.XsdSchema; import org.springframework.xml.xsd.XsdSchema;
/**
* Configures Spring Web Service components
*
* @author Maciej Walkowiak
*/
@EnableWs @EnableWs
@Configuration @Configuration
public class WebServiceConfig extends WsConfigurerAdapter { public class WebServiceConfig extends WsConfigurerAdapter {
@Bean @Bean
public ServletRegistrationBean dispatcherServlet(ApplicationContext applicationContext) { public ServletRegistrationBean dispatcherServlet(ApplicationContext applicationContext) {
MessageDispatcherServlet servlet = new MessageDispatcherServlet(); MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(applicationContext); servlet.setApplicationContext(applicationContext);
return new ServletRegistrationBean(servlet, "/services/*"); return new ServletRegistrationBean(servlet, "/services/*");
} }

View File

@ -1,5 +1,26 @@
/*
* Copyright 2012-2014 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 sample.ws.endpoint; package sample.ws.endpoint;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactoryConfigurationException;
import org.jdom2.Element; import org.jdom2.Element;
import org.jdom2.JDOMException; import org.jdom2.JDOMException;
import org.jdom2.Namespace; import org.jdom2.Namespace;
@ -10,17 +31,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint; import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot; import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload; import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import sample.ws.service.HumanResourceService; import sample.ws.service.HumanResourceService;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactoryConfigurationException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* @author in329dei
* @author Maciej Walkowiak
*/
@Endpoint @Endpoint
public class HolidayEndpoint { public class HolidayEndpoint {
@ -33,25 +46,34 @@ public class HolidayEndpoint {
private HumanResourceService humanResourceService; private HumanResourceService humanResourceService;
@Autowired @Autowired
public HolidayEndpoint(HumanResourceService humanResourceService) throws JDOMException, XPathFactoryConfigurationException, XPathExpressionException { public HolidayEndpoint(HumanResourceService humanResourceService)
throws JDOMException, XPathFactoryConfigurationException,
XPathExpressionException {
this.humanResourceService = humanResourceService; this.humanResourceService = humanResourceService;
Namespace namespace = Namespace.getNamespace("hr", NAMESPACE_URI); Namespace namespace = Namespace.getNamespace("hr", NAMESPACE_URI);
XPathFactory xPathFactory = XPathFactory.instance(); XPathFactory xPathFactory = XPathFactory.instance();
startDateExpression = xPathFactory.compile("//hr:StartDate", Filters.element(), null, namespace); this.startDateExpression = xPathFactory.compile("//hr:StartDate",
endDateExpression = xPathFactory.compile("//hr:EndDate", Filters.element(), null, namespace); Filters.element(), null, namespace);
nameExpression = xPathFactory.compile("concat(//hr:FirstName,' ',//hr:LastName)", Filters.fstring(), null, namespace); this.endDateExpression = xPathFactory.compile("//hr:EndDate", Filters.element(),
null, namespace);
this.nameExpression = xPathFactory.compile(
"concat(//hr:FirstName,' ',//hr:LastName)", Filters.fstring(), null,
namespace);
} }
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "HolidayRequest") @PayloadRoot(namespace = NAMESPACE_URI, localPart = "HolidayRequest")
public void handleHolidayRequest(@RequestPayload Element holidayRequest) throws Exception { public void handleHolidayRequest(@RequestPayload Element holidayRequest)
throws Exception {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date startDate = dateFormat.parse(startDateExpression.evaluateFirst(holidayRequest).getText()); Date startDate = dateFormat.parse(this.startDateExpression.evaluateFirst(
Date endDate = dateFormat.parse(endDateExpression.evaluateFirst(holidayRequest).getText()); holidayRequest).getText());
String name = nameExpression.evaluateFirst(holidayRequest); Date endDate = dateFormat.parse(this.endDateExpression.evaluateFirst(
holidayRequest).getText());
String name = this.nameExpression.evaluateFirst(holidayRequest);
humanResourceService.bookHoliday(startDate, endDate, name); this.humanResourceService.bookHoliday(startDate, endDate, name);
} }
} }

View File

@ -1,10 +1,23 @@
/*
* Copyright 2012-2014 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 sample.ws.service; package sample.ws.service;
import java.util.Date; import java.util.Date;
/**
* Created by in329dei on 28-2-14.
*/
public interface HumanResourceService { public interface HumanResourceService {
void bookHoliday(Date startDate, Date endDate, String name); void bookHoliday(Date startDate, Date endDate, String name);
} }

View File

@ -1,20 +1,34 @@
/*
* Copyright 2012-2014 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 sample.ws.service; package sample.ws.service;
import java.util.Date;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date;
/**
* Created by in329dei on 28-2-14.
*/
@Service @Service
public class StubHumanResourceService implements HumanResourceService { public class StubHumanResourceService implements HumanResourceService {
private final Logger logger = LoggerFactory.getLogger(StubHumanResourceService.class); private final Logger logger = LoggerFactory.getLogger(StubHumanResourceService.class);
@Override @Override
public void bookHoliday(Date startDate, Date endDate, String name) { public void bookHoliday(Date startDate, Date endDate, String name) {
logger.info("Booking holiday for [{} - {}] for [{}] ", startDate, endDate, name); this.logger.info("Booking holiday for [{} - {}] for [{}] ", startDate, endDate,
name);
} }
} }

View File

@ -1,26 +1,26 @@
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:hr="http://mycompany.com/hr/schemas" xmlns:hr="http://mycompany.com/hr/schemas"
elementFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://mycompany.com/hr/schemas"> targetNamespace="http://mycompany.com/hr/schemas">
<xs:element name="HolidayRequest"> <xs:element name="HolidayRequest">
<xs:complexType> <xs:complexType>
<xs:all> <xs:all>
<xs:element name="Holiday" type="hr:HolidayType"/> <xs:element name="Holiday" type="hr:HolidayType"/>
<xs:element name="Employee" type="hr:EmployeeType"/> <xs:element name="Employee" type="hr:EmployeeType"/>
</xs:all> </xs:all>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:complexType name="HolidayType"> <xs:complexType name="HolidayType">
<xs:sequence> <xs:sequence>
<xs:element name="StartDate" type="xs:date"/> <xs:element name="StartDate" type="xs:date"/>
<xs:element name="EndDate" type="xs:date"/> <xs:element name="EndDate" type="xs:date"/>
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
<xs:complexType name="EmployeeType"> <xs:complexType name="EmployeeType">
<xs:sequence> <xs:sequence>
<xs:element name="Number" type="xs:integer"/> <xs:element name="Number" type="xs:integer"/>
<xs:element name="FirstName" type="xs:string"/> <xs:element name="FirstName" type="xs:string"/>
<xs:element name="LastName" type="xs:string"/> <xs:element name="LastName" type="xs:string"/>
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:schema> </xs:schema>

View File

@ -1,5 +1,25 @@
/*
* Copyright 2012-2014 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 sample.ws; package sample.ws;
import java.io.StringReader;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -10,20 +30,12 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.ws.client.core.WebServiceTemplate; import org.springframework.ws.client.core.WebServiceTemplate;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import java.io.StringReader;
/**
* Tests handling SOAP message
*
* @author Maciej Walkowiak
*/
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = SampleWsApplication.class) @SpringApplicationConfiguration(classes = SampleWsApplication.class)
@WebAppConfiguration @WebAppConfiguration
@IntegrationTest @IntegrationTest
public class SampleWsApplicationTests { public class SampleWsApplicationTests {
private WebServiceTemplate webServiceTemplate = new WebServiceTemplate(); private WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
@Value("${local.server.port}") @Value("${local.server.port}")
@ -31,7 +43,8 @@ public class SampleWsApplicationTests {
@Before @Before
public void setUp() { public void setUp() {
webServiceTemplate.setDefaultUri("http://localhost:" + serverPort + "/services/"); this.webServiceTemplate.setDefaultUri("http://localhost:" + this.serverPort
+ "/services/");
} }
@Test @Test
@ -51,6 +64,6 @@ public class SampleWsApplicationTests {
StreamSource source = new StreamSource(new StringReader(request)); StreamSource source = new StreamSource(new StringReader(request));
StreamResult result = new StreamResult(System.out); StreamResult result = new StreamResult(System.out);
webServiceTemplate.sendSourceAndReceiveToResult(source, result); this.webServiceTemplate.sendSourceAndReceiveToResult(source, result);
} }
} }

View File

@ -2,28 +2,41 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent> <parent>
<artifactId>spring-boot-starters</artifactId>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starters</artifactId>
<version>1.1.0.BUILD-SNAPSHOT</version> <version>1.1.0.BUILD-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-boot-starter-ws</artifactId> <artifactId>spring-boot-starter-ws</artifactId>
<packaging>jar</packaging> <name>Spring Boot Web Services Starter</name>
<description>Spring Boot Web Services Starter</description>
<url>http://projects.spring.io/spring-boot/</url>
<organization>
<name>Pivotal Software, Inc.</name>
<url>http://www.spring.io</url>
</organization>
<properties> <properties>
<main.basedir>${basedir}/../..</main.basedir> <main.basedir>${basedir}/../..</main.basedir>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId> <artifactId>spring-boot-starter</artifactId>
<version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId> <artifactId>spring-boot-starter-web</artifactId>
<version>${project.version}</version> </dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.ws</groupId> <groupId>org.springframework.ws</groupId>
@ -33,16 +46,5 @@
<groupId>org.springframework.ws</groupId> <groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-support</artifactId> <artifactId>spring-ws-support</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-security</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -1 +1 @@
provides: spring-ws-core,spring-ws-support,spring-ws-security provides: spring-ws-core,spring-ws-support

View File

@ -273,5 +273,9 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId> <artifactId>spring-boot-starter-websocket</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-ws</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>