Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
5881c9c7
Commit
5881c9c7
authored
Apr 16, 2016
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
43256ee7
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
100 additions
and
99 deletions
+100
-99
CrshAutoConfiguration.java
...ork/boot/actuate/autoconfigure/CrshAutoConfiguration.java
+6
-6
LocalManagementPort.java
...ework/boot/actuate/autoconfigure/LocalManagementPort.java
+1
-0
ShellProperties.java
...framework/boot/actuate/autoconfigure/ShellProperties.java
+8
-4
CrshAutoConfigurationTests.java
...oot/actuate/autoconfigure/CrshAutoConfigurationTests.java
+3
-6
ShellPropertiesTests.java
...work/boot/actuate/autoconfigure/ShellPropertiesTests.java
+14
-12
WebServicesAutoConfiguration.java
...toconfigure/webservices/WebServicesAutoConfiguration.java
+9
-8
WebServicesProperties.java
...boot/autoconfigure/webservices/WebServicesProperties.java
+3
-4
package-info.java
...ramework/boot/autoconfigure/webservices/package-info.java
+1
-1
spring.factories
...utoconfigure/src/main/resources/META-INF/spring.factories
+1
-1
WebServicesAutoConfigurationTests.java
...figure/webservices/WebServicesAutoConfigurationTests.java
+18
-17
pom.xml
spring-boot-dependencies/pom.xml
+6
-6
appendix-application-properties.adoc
...cs/src/main/asciidoc/appendix-application-properties.adoc
+4
-4
index.adoc
spring-boot-docs/src/main/asciidoc/index.adoc
+1
-1
spring-boot-features.adoc
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+3
-3
pom.xml
spring-boot-samples/pom.xml
+1
-1
README.adoc
...g-boot-samples/spring-boot-sample-webservices/README.adoc
+0
-0
pom.xml
spring-boot-samples/spring-boot-sample-webservices/pom.xml
+2
-2
SampleWebServicesApplication.java
...java/sample/webservices/SampleWebServicesApplication.java
+3
-3
WebServiceConfig.java
...es/src/main/java/sample/webservices/WebServiceConfig.java
+7
-7
HolidayEndpoint.java
...ain/java/sample/webservices/endpoint/HolidayEndpoint.java
+4
-6
HumanResourceService.java
...java/sample/webservices/service/HumanResourceService.java
+1
-1
StubHumanResourceService.java
.../sample/webservices/service/StubHumanResourceService.java
+1
-1
hr.xsd
...le-webservices/src/main/resources/META-INF/schemas/hr.xsd
+0
-0
SampleWsApplicationTests.java
...est/java/sample/webservices/SampleWsApplicationTests.java
+1
-3
pom.xml
spring-boot-starters/pom.xml
+1
-1
pom.xml
spring-boot-starters/spring-boot-starter-webservices/pom.xml
+1
-1
spring.provides
...r-webservices/src/main/resources/META-INF/spring.provides
+0
-0
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java
View file @
5881c9c7
...
...
@@ -93,12 +93,12 @@ import org.springframework.util.StringUtils;
* <p>
* If a Spring Security {@link AuthenticationManager} is detected, this configuration will
* create a {@link CRaSHPlugin} to forward shell authentication requests to Spring
* Security. This authentication method will get enabled if
{@code management.shell.auth.type}
*
is set to {@code spring} or if no explicit {@code management.shell.auth} is provided
*
and a {@link AuthenticationManager} is available. In the latter case shell access will
*
be restricted to users having roles that match those configured in
*
{@link ManagementServerProperties}. Required roles can be overridden by
* {@code management.shell.auth.spring.roles}.
* Security. This authentication method will get enabled if
*
{@code management.shell.auth.type} is set to {@code spring} or if no explicit
*
{@code management.shell.auth} is provided and a {@link AuthenticationManager} is
*
available. In the latter case shell access will be restricted to users having roles
*
that match those configured in {@link ManagementServerProperties}. Required roles can
*
be overridden by
{@code management.shell.auth.spring.roles}.
* <p>
* To add customizations to the shell simply define beans of type {@link CRaSHPlugin} in
* the application context. Those beans will get auto detected during startup and
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/LocalManagementPort.java
View file @
5881c9c7
...
...
@@ -38,4 +38,5 @@ import org.springframework.beans.factory.annotation.Value;
@Documented
@Value
(
"${local.management.port}"
)
public
@interface
LocalManagementPort
{
}
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java
View file @
5881c9c7
...
...
@@ -375,7 +375,8 @@ public class ShellProperties {
/**
* Auth specific properties for JAAS authentication.
*/
@ConfigurationProperties
(
prefix
=
SHELL_PREFIX
+
".auth.jaas"
,
ignoreUnknownFields
=
false
)
@ConfigurationProperties
(
prefix
=
SHELL_PREFIX
+
".auth.jaas"
,
ignoreUnknownFields
=
false
)
public
static
class
JaasAuthenticationProperties
extends
CrshShellAuthenticationProperties
{
...
...
@@ -404,7 +405,8 @@ public class ShellProperties {
/**
* Auth specific properties for key authentication.
*/
@ConfigurationProperties
(
prefix
=
SHELL_PREFIX
+
".auth.key"
,
ignoreUnknownFields
=
false
)
@ConfigurationProperties
(
prefix
=
SHELL_PREFIX
+
".auth.key"
,
ignoreUnknownFields
=
false
)
public
static
class
KeyAuthenticationProperties
extends
CrshShellAuthenticationProperties
{
...
...
@@ -435,7 +437,8 @@ public class ShellProperties {
/**
* Auth specific properties for simple authentication.
*/
@ConfigurationProperties
(
prefix
=
SHELL_PREFIX
+
".auth.simple"
,
ignoreUnknownFields
=
false
)
@ConfigurationProperties
(
prefix
=
SHELL_PREFIX
+
".auth.simple"
,
ignoreUnknownFields
=
false
)
public
static
class
SimpleAuthenticationProperties
extends
CrshShellAuthenticationProperties
{
...
...
@@ -511,7 +514,8 @@ public class ShellProperties {
/**
* Auth specific properties for Spring authentication.
*/
@ConfigurationProperties
(
prefix
=
SHELL_PREFIX
+
".auth.spring"
,
ignoreUnknownFields
=
false
)
@ConfigurationProperties
(
prefix
=
SHELL_PREFIX
+
".auth.spring"
,
ignoreUnknownFields
=
false
)
public
static
class
SpringAuthenticationProperties
extends
CrshShellAuthenticationProperties
{
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfigurationTests.java
View file @
5881c9c7
...
...
@@ -81,8 +81,8 @@ public class CrshAutoConfigurationTests {
@Test
public
void
testDisabledPlugins
()
throws
Exception
{
load
(
"management.shell.disabled_plugins="
+
"termIOHandler, org.crsh.auth.AuthenticationPlugin, javaLanguage"
);
load
(
"management.shell.disabled_plugins="
+
"termIOHandler, org.crsh.auth.AuthenticationPlugin, javaLanguage"
);
PluginLifeCycle
lifeCycle
=
this
.
context
.
getBean
(
PluginLifeCycle
.
class
);
assertThat
(
lifeCycle
).
isNotNull
();
assertThat
(
lifeCycle
.
getContext
().
getPlugins
(
TermIOHandler
.
class
))
...
...
@@ -109,8 +109,7 @@ public class CrshAutoConfigurationTests {
@Test
public
void
testSshConfiguration
()
{
load
(
"management.shell.ssh.enabled=true"
,
"management.shell.ssh.port=3333"
);
load
(
"management.shell.ssh.enabled=true"
,
"management.shell.ssh.port=3333"
);
PluginLifeCycle
lifeCycle
=
this
.
context
.
getBean
(
PluginLifeCycle
.
class
);
assertThat
(
lifeCycle
.
getConfig
().
getProperty
(
"crash.ssh.port"
)).
isEqualTo
(
"3333"
);
assertThat
(
lifeCycle
.
getConfig
().
getProperty
(
"crash.ssh.auth_timeout"
))
...
...
@@ -140,7 +139,6 @@ public class CrshAutoConfigurationTests {
.
isEqualTo
(
"400000"
);
}
@Test
public
void
testCommandResolution
()
{
load
();
...
...
@@ -329,7 +327,6 @@ public class CrshAutoConfigurationTests {
this
.
context
.
refresh
();
}
@Configuration
public
static
class
SecurityConfiguration
{
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ShellPropertiesTests.java
View file @
5881c9c7
...
...
@@ -65,7 +65,8 @@ public class ShellPropertiesTests {
@Test
public
void
testBindingAuth
()
{
ShellProperties
props
=
load
(
ShellProperties
.
class
,
"management.shell.auth.type=spring"
);
ShellProperties
props
=
load
(
ShellProperties
.
class
,
"management.shell.auth.type=spring"
);
assertThat
(
props
.
getAuth
().
getType
()).
isEqualTo
(
"spring"
);
}
...
...
@@ -78,7 +79,8 @@ public class ShellPropertiesTests {
@Test
public
void
testBindingCommandRefreshInterval
()
{
ShellProperties
props
=
load
(
ShellProperties
.
class
,
"management.shell.command-refresh-interval=1"
);
ShellProperties
props
=
load
(
ShellProperties
.
class
,
"management.shell.command-refresh-interval=1"
);
assertThat
(
props
.
getCommandRefreshInterval
()).
isEqualTo
(
1
);
}
...
...
@@ -87,7 +89,7 @@ public class ShellPropertiesTests {
ShellProperties
props
=
load
(
ShellProperties
.
class
,
"management.shell.command-path-patterns=pattern1, pattern2"
);
assertThat
(
props
.
getCommandPathPatterns
().
length
).
isEqualTo
(
2
);
Assert
.
assertArrayEquals
(
new
String
[]
{
"pattern1"
,
"pattern2"
},
Assert
.
assertArrayEquals
(
new
String
[]
{
"pattern1"
,
"pattern2"
},
props
.
getCommandPathPatterns
());
}
...
...
@@ -96,7 +98,7 @@ public class ShellPropertiesTests {
ShellProperties
props
=
load
(
ShellProperties
.
class
,
"management.shell.config-path-patterns=pattern1, pattern2"
);
assertThat
(
props
.
getConfigPathPatterns
().
length
).
isEqualTo
(
2
);
Assert
.
assertArrayEquals
(
new
String
[]
{
"pattern1"
,
"pattern2"
},
Assert
.
assertArrayEquals
(
new
String
[]
{
"pattern1"
,
"pattern2"
},
props
.
getConfigPathPatterns
());
}
...
...
@@ -118,8 +120,7 @@ public class ShellPropertiesTests {
@Test
public
void
testBindingSsh
()
{
ShellProperties
props
=
load
(
ShellProperties
.
class
,
"management.shell.ssh.enabled=true"
,
"management.shell.ssh.port=2222"
,
"management.shell.ssh.enabled=true"
,
"management.shell.ssh.port=2222"
,
"management.shell.ssh.key-path=~/.ssh/test.pem"
);
Properties
p
=
props
.
asCrshShellConfig
();
assertThat
(
p
.
get
(
"crash.ssh.port"
)).
isEqualTo
(
"2222"
);
...
...
@@ -129,8 +130,7 @@ public class ShellPropertiesTests {
@Test
public
void
testBindingSshIgnored
()
{
ShellProperties
props
=
load
(
ShellProperties
.
class
,
"management.shell.ssh.enabled=false"
,
"management.shell.ssh.port=2222"
,
"management.shell.ssh.enabled=false"
,
"management.shell.ssh.port=2222"
,
"management.shell.ssh.key-path=~/.ssh/test.pem"
);
Properties
p
=
props
.
asCrshShellConfig
();
assertThat
(
p
.
get
(
"crash.ssh.port"
)).
isNull
();
...
...
@@ -194,14 +194,16 @@ public class ShellPropertiesTests {
@Test
public
void
testDefaultPasswordAutoGeneratedIfUnresolvedPlaceholder
()
{
SimpleAuthenticationProperties
security
=
load
(
SimpleAuthenticationProperties
.
class
,
SimpleAuthenticationProperties
security
=
load
(
SimpleAuthenticationProperties
.
class
,
"management.shell.auth.simple.user.password=${ADMIN_PASSWORD}"
);
assertThat
(
security
.
getUser
().
isDefaultPassword
()).
isTrue
();
}
@Test
public
void
testDefaultPasswordAutoGeneratedIfEmpty
()
{
SimpleAuthenticationProperties
security
=
load
(
SimpleAuthenticationProperties
.
class
,
SimpleAuthenticationProperties
security
=
load
(
SimpleAuthenticationProperties
.
class
,
"management.shell.auth.simple.user.password="
);
assertThat
(
security
.
getUser
().
isDefaultPassword
()).
isTrue
();
}
...
...
@@ -242,9 +244,9 @@ public class ShellPropertiesTests {
}
@Configuration
@EnableConfigurationProperties
({
ShellProperties
.
class
,
@EnableConfigurationProperties
({
ShellProperties
.
class
,
JaasAuthenticationProperties
.
class
,
KeyAuthenticationProperties
.
class
,
SimpleAuthenticationProperties
.
class
,
SpringAuthenticationProperties
.
class
})
SimpleAuthenticationProperties
.
class
,
SpringAuthenticationProperties
.
class
})
static
class
TestConfiguration
{
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/w
s/W
sAutoConfiguration.java
→
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/w
ebservices/WebService
sAutoConfiguration.java
View file @
5881c9c7
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
ws
;
package
org
.
springframework
.
boot
.
autoconfigure
.
w
ebservice
s
;
import
java.util.Map
;
...
...
@@ -44,13 +44,13 @@ import org.springframework.ws.transport.http.MessageDispatcherServlet;
@ConditionalOnWebApplication
@ConditionalOnClass
(
MessageDispatcherServlet
.
class
)
@ConditionalOnMissingBean
(
WsConfigurationSupport
.
class
)
@EnableConfigurationProperties
(
WsProperties
.
class
)
@EnableConfigurationProperties
(
W
ebService
sProperties
.
class
)
@AutoConfigureAfter
(
EmbeddedServletContainerAutoConfiguration
.
class
)
public
class
WsAutoConfiguration
{
public
class
W
ebService
sAutoConfiguration
{
private
final
WsProperties
properties
;
private
final
W
ebService
sProperties
properties
;
public
W
sAutoConfiguration
(
W
sProperties
properties
)
{
public
W
ebServicesAutoConfiguration
(
WebService
sProperties
properties
)
{
this
.
properties
=
properties
;
}
...
...
@@ -61,9 +61,9 @@ public class WsAutoConfiguration {
servlet
.
setApplicationContext
(
applicationContext
);
String
path
=
this
.
properties
.
getPath
();
String
urlMapping
=
(
path
.
endsWith
(
"/"
)
?
path
+
"*"
:
path
+
"/*"
);
ServletRegistrationBean
registration
=
new
ServletRegistrationBean
(
servlet
,
urlMapping
);
WsProperties
.
Servlet
servletProperties
=
this
.
properties
.
getServlet
();
ServletRegistrationBean
registration
=
new
ServletRegistrationBean
(
servlet
,
urlMapping
);
W
ebService
sProperties
.
Servlet
servletProperties
=
this
.
properties
.
getServlet
();
registration
.
setLoadOnStartup
(
servletProperties
.
getLoadOnStartup
());
for
(
Map
.
Entry
<
String
,
String
>
entry
:
servletProperties
.
getInit
().
entrySet
())
{
registration
.
addInitParameter
(
entry
.
getKey
(),
entry
.
getValue
());
...
...
@@ -74,6 +74,7 @@ public class WsAutoConfiguration {
@Configuration
@EnableWs
protected
static
class
WsConfiguration
{
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/w
s/W
sProperties.java
→
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/w
ebservices/WebService
sProperties.java
View file @
5881c9c7
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
ws
;
package
org
.
springframework
.
boot
.
autoconfigure
.
w
ebservice
s
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -31,8 +31,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* @author Stephane Nicoll
* @since 1.4.0
*/
@ConfigurationProperties
(
"spring.ws"
)
public
class
WsProperties
{
@ConfigurationProperties
(
"spring.w
ebservice
s"
)
public
class
W
ebService
sProperties
{
/**
* Path that serves as the base URI for the services.
...
...
@@ -55,7 +55,6 @@ public class WsProperties {
return
this
.
servlet
;
}
public
static
class
Servlet
{
/**
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ws/package-info.java
→
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/w
ebservice
s/package-info.java
View file @
5881c9c7
...
...
@@ -17,4 +17,4 @@
/**
* Auto-configuration for Spring Web Services.
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
ws
;
package
org
.
springframework
.
boot
.
autoconfigure
.
w
ebservice
s
;
spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories
View file @
5881c9c7
...
...
@@ -97,7 +97,7 @@ org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration,\
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration,\
org.springframework.boot.autoconfigure.websocket.WebSocketAutoConfiguration,\
org.springframework.boot.autoconfigure.websocket.WebSocketMessagingAutoConfiguration,\
org.springframework.boot.autoconfigure.w
s.W
sAutoConfiguration
org.springframework.boot.autoconfigure.w
ebservices.WebService
sAutoConfiguration
# Template availability providers
org.springframework.boot.autoconfigure.template.TemplateAvailabilityProvider=\
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/w
s/W
sAutoConfigurationTests.java
→
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/w
ebservices/WebService
sAutoConfigurationTests.java
View file @
5881c9c7
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
ws
;
package
org
.
springframework
.
boot
.
autoconfigure
.
w
ebservice
s
;
import
org.junit.After
;
import
org.junit.Rule
;
...
...
@@ -31,12 +31,12 @@ import org.springframework.web.context.support.AnnotationConfigWebApplicationCon
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
* Tests for {@link WsAutoConfiguration}.
* Tests for {@link W
ebService
sAutoConfiguration}.
*
* @author Vedran Pavic
* @author Stephane Nicoll
*/
public
class
WsAutoConfigurationTests
{
public
class
W
ebService
sAutoConfigurationTests
{
@Rule
public
ExpectedException
thrown
=
ExpectedException
.
none
();
...
...
@@ -52,8 +52,7 @@ public class WsAutoConfigurationTests {
@Test
public
void
defaultConfiguration
()
{
load
(
WsAutoConfiguration
.
class
);
load
(
WebServicesAutoConfiguration
.
class
);
assertThat
(
this
.
context
.
getBeansOfType
(
ServletRegistrationBean
.
class
)).
hasSize
(
1
);
}
...
...
@@ -61,19 +60,19 @@ public class WsAutoConfigurationTests {
public
void
customPathMustBeginWithASlash
()
{
this
.
thrown
.
expect
(
BeanCreationException
.
class
);
this
.
thrown
.
expectMessage
(
"Path must start with /"
);
load
(
W
sAutoConfiguration
.
class
,
"spring.w
s.path=invalid"
);
load
(
W
ebServicesAutoConfiguration
.
class
,
"spring.webservice
s.path=invalid"
);
}
@Test
public
void
customPathWithTrailingSlash
()
{
load
(
W
sAutoConfiguration
.
class
,
"spring.w
s.path=/valid/"
);
load
(
W
ebServicesAutoConfiguration
.
class
,
"spring.webservice
s.path=/valid/"
);
assertThat
(
this
.
context
.
getBean
(
ServletRegistrationBean
.
class
).
getUrlMappings
())
.
contains
(
"/valid/*"
);
}
@Test
public
void
customPath
()
{
load
(
W
sAutoConfiguration
.
class
,
"spring.w
s.path=/valid"
);
load
(
W
ebServicesAutoConfiguration
.
class
,
"spring.webservice
s.path=/valid"
);
assertThat
(
this
.
context
.
getBeansOfType
(
ServletRegistrationBean
.
class
)).
hasSize
(
1
);
assertThat
(
this
.
context
.
getBean
(
ServletRegistrationBean
.
class
).
getUrlMappings
())
.
contains
(
"/valid/*"
);
...
...
@@ -81,7 +80,8 @@ public class WsAutoConfigurationTests {
@Test
public
void
customLoadOnStartup
()
{
load
(
WsAutoConfiguration
.
class
,
"spring.ws.servlet.load-on-startup=1"
);
load
(
WebServicesAutoConfiguration
.
class
,
"spring.webservices.servlet.load-on-startup=1"
);
ServletRegistrationBean
registrationBean
=
this
.
context
.
getBean
(
ServletRegistrationBean
.
class
);
assertThat
(
ReflectionTestUtils
.
getField
(
registrationBean
,
"loadOnStartup"
))
...
...
@@ -90,8 +90,9 @@ public class WsAutoConfigurationTests {
@Test
public
void
customInitParameters
()
{
load
(
WsAutoConfiguration
.
class
,
"spring.ws.servlet.init.key1=value1"
,
"spring.ws.servlet.init.key2=value2"
);
load
(
WebServicesAutoConfiguration
.
class
,
"spring.webservices.servlet.init.key1=value1"
,
"spring.webservices.servlet.init.key2=value2"
);
ServletRegistrationBean
registrationBean
=
this
.
context
.
getBean
(
ServletRegistrationBean
.
class
);
assertThat
(
registrationBean
.
getInitParameters
()).
containsEntry
(
"key1"
,
"value1"
);
...
...
@@ -99,12 +100,12 @@ public class WsAutoConfigurationTests {
}
private
void
load
(
Class
<?>
config
,
String
...
environment
)
{
AnnotationConfigWebApplicationContext
c
tx
=
new
AnnotationConfigWebApplicationContext
();
c
tx
.
setServletContext
(
new
MockServletContext
());
EnvironmentTestUtils
.
addEnvironment
(
c
tx
,
environment
);
c
tx
.
register
(
config
);
c
tx
.
refresh
();
this
.
context
=
c
tx
;
AnnotationConfigWebApplicationContext
c
ontext
=
new
AnnotationConfigWebApplicationContext
();
c
ontext
.
setServletContext
(
new
MockServletContext
());
EnvironmentTestUtils
.
addEnvironment
(
c
ontext
,
environment
);
c
ontext
.
register
(
config
);
c
ontext
.
refresh
();
this
.
context
=
c
ontext
;
}
}
spring-boot-dependencies/pom.xml
View file @
5881c9c7
...
...
@@ -160,7 +160,7 @@
<spring-social-facebook.version>
2.0.3.RELEASE
</spring-social-facebook.version>
<spring-social-linkedin.version>
1.0.2.RELEASE
</spring-social-linkedin.version>
<spring-social-twitter.version>
1.1.2.RELEASE
</spring-social-twitter.version>
<spring-w
s.version>
2.3.0.RELEASE
</spring-w
s.version>
<spring-w
ebservices.version>
2.3.0.RELEASE
</spring-webservice
s.version>
<sqlite-jdbc.version>
3.8.11.2
</sqlite-jdbc.version>
<statsd-client.version>
3.1.0
</statsd-client.version>
<sun-mail.version>
${javax-mail.version}
</sun-mail.version>
...
...
@@ -505,7 +505,7 @@
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-ws
</artifactId>
<artifactId>
spring-boot-starter-w
ebservice
s
</artifactId>
<version>
1.4.0.BUILD-SNAPSHOT
</version>
</dependency>
...
...
@@ -2179,7 +2179,7 @@
<dependency>
<groupId>
org.springframework.ws
</groupId>
<artifactId>
spring-ws-core
</artifactId>
<version>
${spring-ws.version}
</version>
<version>
${spring-w
ebservice
s.version}
</version>
<exclusions>
<exclusion>
<groupId>
commons-logging
</groupId>
...
...
@@ -2190,7 +2190,7 @@
<dependency>
<groupId>
org.springframework.ws
</groupId>
<artifactId>
spring-ws-security
</artifactId>
<version>
${spring-ws.version}
</version>
<version>
${spring-w
ebservice
s.version}
</version>
<exclusions>
<exclusion>
<groupId>
commons-logging
</groupId>
...
...
@@ -2201,7 +2201,7 @@
<dependency>
<groupId>
org.springframework.ws
</groupId>
<artifactId>
spring-ws-support
</artifactId>
<version>
${spring-ws.version}
</version>
<version>
${spring-w
ebservice
s.version}
</version>
<exclusions>
<exclusion>
<groupId>
commons-logging
</groupId>
...
...
@@ -2212,7 +2212,7 @@
<dependency>
<groupId>
org.springframework.ws
</groupId>
<artifactId>
spring-ws-test
</artifactId>
<version>
${spring-ws.version}
</version>
<version>
${spring-w
ebservice
s.version}
</version>
<exclusions>
<exclusion>
<groupId>
commons-logging
</groupId>
...
...
spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
View file @
5881c9c7
...
...
@@ -406,10 +406,10 @@ content into your application; rather pick only the properties that you need.
spring.velocity.toolbox-config-location= # Velocity Toolbox config location. For instance `/WEB-INF/toolbox.xml`
spring.velocity.view-names= # White list of view names that can be resolved.
# WEB SERVICES ({sc-spring-boot-autoconfigure}/w
s/WsProperties.{sc-ext}[W
sProperties])
spring.ws.path=/services # Path that serves as the base URI for the services.
spring.ws.servlet.init= # Servlet init parameters to pass to Spring Web Services.
spring.ws.servlet.load-on-startup=-1 # Load on startup priority of the Spring Web Services servlet.
# WEB SERVICES ({sc-spring-boot-autoconfigure}/w
ebservices/WebServicesProperties.{sc-ext}[WebService
sProperties])
spring.w
ebservice
s.path=/services # Path that serves as the base URI for the services.
spring.w
ebservice
s.servlet.init= # Servlet init parameters to pass to Spring Web Services.
spring.w
ebservice
s.servlet.load-on-startup=-1 # Load on startup priority of the Spring Web Services servlet.
[[common-application-properties-security]]
...
...
spring-boot-docs/src/main/asciidoc/index.adoc
View file @
5881c9c7
...
...
@@ -37,7 +37,7 @@ Phillip Webb; Dave Syer; Josh Long; Stéphane Nicoll; Rob Winch; Andy Wilkinson;
:spring-boot-maven-plugin-site: http://docs.spring.io/spring-boot/docs/{spring-boot-docs-version}/maven-plugin
:spring-reference: http://docs.spring.io/spring/docs/{spring-docs-version}/spring-framework-reference/htmlsingle
:spring-security-reference: http://docs.spring.io/spring-security/site/docs/{spring-security-docs-version}/reference/htmlsingle
:spring-w
s-reference: http://docs.spring.io/spring-ws/docs/{spring-w
s-docs-version}/reference/htmlsingle
:spring-w
ebservices-reference: http://docs.spring.io/spring-ws/docs/{spring-webservice
s-docs-version}/reference/htmlsingle
:spring-javadoc: http://docs.spring.io/spring/docs/{spring-docs-version}/javadoc-api/org/springframework
:spring-amqp-javadoc: http://docs.spring.io/spring-amqp/docs/current/api/org/springframework/amqp
:spring-data-javadoc: http://docs.spring.io/spring-data/jpa/docs/current/api/org/springframework/data/jpa
...
...
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
5881c9c7
...
...
@@ -5002,13 +5002,13 @@ be easily accessed via the `spring-boot-starter-websocket` module.
[[boot-features-ws]]
[[boot-features-w
ebservice
s]]
== Web Services
Spring Boot provides Web Services auto-configuration so that all is required is defining
your `Endpoints`.
The {spring-w
s-reference}[Spring Web Services features] can be easily accessed via the
`spring-boot-starter-w
s` module.
The {spring-w
ebservices-reference}[Spring Web Services features] can be easily accessed
via the `spring-boot-starter-webservice
s` module.
...
...
spring-boot-samples/pom.xml
View file @
5881c9c7
...
...
@@ -106,7 +106,7 @@
<module>
spring-boot-sample-websocket-jetty
</module>
<module>
spring-boot-sample-websocket-tomcat
</module>
<module>
spring-boot-sample-websocket-undertow
</module>
<module>
spring-boot-sample-ws
</module>
<module>
spring-boot-sample-w
ebservice
s
</module>
<module>
spring-boot-sample-xml
</module>
</modules>
<!-- No dependencies - otherwise the samples won't work if you change the
...
...
spring-boot-samples/spring-boot-sample-ws/README.adoc
→
spring-boot-samples/spring-boot-sample-w
ebservice
s/README.adoc
View file @
5881c9c7
File moved
spring-boot-samples/spring-boot-sample-ws/pom.xml
→
spring-boot-samples/spring-boot-sample-w
ebservice
s/pom.xml
View file @
5881c9c7
...
...
@@ -7,7 +7,7 @@
<groupId>
org.springframework.boot
</groupId>
<version>
1.4.0.BUILD-SNAPSHOT
</version>
</parent>
<artifactId>
spring-boot-sample-ws
</artifactId>
<artifactId>
spring-boot-sample-w
ebservice
s
</artifactId>
<name>
Spring Boot Web Services Sample
</name>
<description>
Spring Boot Web Services Sample
</description>
<url>
http://projects.spring.io/spring-boot/
</url>
...
...
@@ -26,7 +26,7 @@
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-ws
</artifactId>
<artifactId>
spring-boot-starter-w
ebservice
s
</artifactId>
</dependency>
<dependency>
<groupId>
jaxen
</groupId>
...
...
spring-boot-samples/spring-boot-sample-w
s/src/main/java/sample/ws/SampleW
sApplication.java
→
spring-boot-samples/spring-boot-sample-w
ebservices/src/main/java/sample/webservices/SampleWebService
sApplication.java
View file @
5881c9c7
...
...
@@ -14,16 +14,16 @@
* limitations under the License.
*/
package
sample
.
ws
;
package
sample
.
w
ebservice
s
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
SampleWsApplication
{
public
class
SampleW
ebService
sApplication
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
SpringApplication
.
run
(
SampleWsApplication
.
class
,
args
);
SpringApplication
.
run
(
SampleW
ebService
sApplication
.
class
,
args
);
}
}
spring-boot-samples/spring-boot-sample-w
s/src/main/java/sample/w
s/WebServiceConfig.java
→
spring-boot-samples/spring-boot-sample-w
ebservices/src/main/java/sample/webservice
s/WebServiceConfig.java
View file @
5881c9c7
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
sample
.
ws
;
package
sample
.
w
ebservice
s
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -29,12 +29,12 @@ public class WebServiceConfig extends WsConfigurerAdapter {
@Bean
(
name
=
"holiday"
)
public
DefaultWsdl11Definition
defaultWsdl11Definition
(
XsdSchema
countriesSchema
)
{
DefaultWsdl11Definition
wsdl
11Definition
=
new
DefaultWsdl11Definition
();
wsdl
11Definition
.
setPortTypeName
(
"HumanResource"
);
wsdl
11Definition
.
setLocationUri
(
"/holidayService/"
);
wsdl
11Definition
.
setTargetNamespace
(
"http://mycompany.com/hr/definitions"
);
wsdl
11Definition
.
setSchema
(
countriesSchema
);
return
wsdl
11Definition
;
DefaultWsdl11Definition
wsdl
=
new
DefaultWsdl11Definition
();
wsdl
.
setPortTypeName
(
"HumanResource"
);
wsdl
.
setLocationUri
(
"/holidayService/"
);
wsdl
.
setTargetNamespace
(
"http://mycompany.com/hr/definitions"
);
wsdl
.
setSchema
(
countriesSchema
);
return
wsdl
;
}
@Bean
...
...
spring-boot-samples/spring-boot-sample-w
s/src/main/java/sample/w
s/endpoint/HolidayEndpoint.java
→
spring-boot-samples/spring-boot-sample-w
ebservices/src/main/java/sample/webservice
s/endpoint/HolidayEndpoint.java
View file @
5881c9c7
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
sample
.
ws
.
endpoint
;
package
sample
.
w
ebservice
s
.
endpoint
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
...
...
@@ -28,7 +28,7 @@ import org.jdom2.Namespace;
import
org.jdom2.filter.Filters
;
import
org.jdom2.xpath.XPathExpression
;
import
org.jdom2.xpath.XPathFactory
;
import
sample.ws.service.HumanResourceService
;
import
sample.w
ebservice
s.service.HumanResourceService
;
import
org.springframework.ws.server.endpoint.annotation.Endpoint
;
import
org.springframework.ws.server.endpoint.annotation.PayloadRoot
;
...
...
@@ -40,7 +40,9 @@ public class HolidayEndpoint {
private
static
final
String
NAMESPACE_URI
=
"http://mycompany.com/hr/schemas"
;
private
XPathExpression
<
Element
>
startDateExpression
;
private
XPathExpression
<
Element
>
endDateExpression
;
private
XPathExpression
<
String
>
nameExpression
;
private
HumanResourceService
humanResourceService
;
...
...
@@ -49,11 +51,8 @@ public class HolidayEndpoint {
throws
JDOMException
,
XPathFactoryConfigurationException
,
XPathExpressionException
{
this
.
humanResourceService
=
humanResourceService
;
Namespace
namespace
=
Namespace
.
getNamespace
(
"hr"
,
NAMESPACE_URI
);
XPathFactory
xPathFactory
=
XPathFactory
.
instance
();
this
.
startDateExpression
=
xPathFactory
.
compile
(
"//hr:StartDate"
,
Filters
.
element
(),
null
,
namespace
);
this
.
endDateExpression
=
xPathFactory
.
compile
(
"//hr:EndDate"
,
Filters
.
element
(),
...
...
@@ -72,7 +71,6 @@ public class HolidayEndpoint {
Date
endDate
=
dateFormat
.
parse
(
this
.
endDateExpression
.
evaluateFirst
(
holidayRequest
).
getText
());
String
name
=
this
.
nameExpression
.
evaluateFirst
(
holidayRequest
);
this
.
humanResourceService
.
bookHoliday
(
startDate
,
endDate
,
name
);
}
...
...
spring-boot-samples/spring-boot-sample-w
s/src/main/java/sample/w
s/service/HumanResourceService.java
→
spring-boot-samples/spring-boot-sample-w
ebservices/src/main/java/sample/webservice
s/service/HumanResourceService.java
View file @
5881c9c7
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
sample
.
ws
.
service
;
package
sample
.
w
ebservice
s
.
service
;
import
java.util.Date
;
...
...
spring-boot-samples/spring-boot-sample-w
s/src/main/java/sample/w
s/service/StubHumanResourceService.java
→
spring-boot-samples/spring-boot-sample-w
ebservices/src/main/java/sample/webservice
s/service/StubHumanResourceService.java
View file @
5881c9c7
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
sample
.
ws
.
service
;
package
sample
.
w
ebservice
s
.
service
;
import
java.util.Date
;
...
...
spring-boot-samples/spring-boot-sample-ws/src/main/resources/META-INF/schemas/hr.xsd
→
spring-boot-samples/spring-boot-sample-w
ebservice
s/src/main/resources/META-INF/schemas/hr.xsd
View file @
5881c9c7
File moved
spring-boot-samples/spring-boot-sample-w
s/src/test/java/sample/w
s/SampleWsApplicationTests.java
→
spring-boot-samples/spring-boot-sample-w
ebservices/src/test/java/sample/webservice
s/SampleWsApplicationTests.java
View file @
5881c9c7
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package
sample
.
ws
;
package
sample
.
w
ebservice
s
;
import
java.io.StringReader
;
...
...
@@ -62,10 +62,8 @@ public class SampleWsApplicationTests {
+
" <hr:FirstName>John</hr:FirstName>"
+
" <hr:LastName>Doe</hr:LastName>"
+
" </hr:Employee>"
+
"</hr:HolidayRequest>"
;
StreamSource
source
=
new
StreamSource
(
new
StringReader
(
request
));
StreamResult
result
=
new
StreamResult
(
System
.
out
);
this
.
webServiceTemplate
.
sendSourceAndReceiveToResult
(
source
,
result
);
assertThat
(
this
.
output
.
toString
()).
contains
(
"Booking holiday for"
);
}
...
...
spring-boot-starters/pom.xml
View file @
5881c9c7
...
...
@@ -69,7 +69,7 @@
<module>
spring-boot-starter-velocity
</module>
<module>
spring-boot-starter-web
</module>
<module>
spring-boot-starter-websocket
</module>
<module>
spring-boot-starter-ws
</module>
<module>
spring-boot-starter-w
ebservice
s
</module>
</modules>
<build>
...
...
spring-boot-starters/spring-boot-starter-ws/pom.xml
→
spring-boot-starters/spring-boot-starter-w
ebservice
s/pom.xml
View file @
5881c9c7
...
...
@@ -6,7 +6,7 @@
<artifactId>
spring-boot-starters
</artifactId>
<version>
1.4.0.BUILD-SNAPSHOT
</version>
</parent>
<artifactId>
spring-boot-starter-ws
</artifactId>
<artifactId>
spring-boot-starter-w
ebservice
s
</artifactId>
<name>
Spring Boot Web Services Starter
</name>
<description>
Starter for using Spring Web Services
</description>
<url>
http://projects.spring.io/spring-boot/
</url>
...
...
spring-boot-starters/spring-boot-starter-ws/src/main/resources/META-INF/spring.provides
→
spring-boot-starters/spring-boot-starter-w
ebservice
s/src/main/resources/META-INF/spring.provides
View file @
5881c9c7
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment