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
f0c0f000
Commit
f0c0f000
authored
Jun 09, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
3975f8c9
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
25 additions
and
5 deletions
+25
-5
pom.xml
spring-boot-samples/pom.xml
+1
-1
README.adoc
spring-boot-samples/spring-boot-sample-ws/README.adoc
+3
-3
SampleWsApplication.java
...ample-ws/src/main/java/sample/ws/SampleWsApplication.java
+2
-0
WebServiceConfig.java
...t-sample-ws/src/main/java/sample/ws/WebServiceConfig.java
+2
-0
HolidayEndpoint.java
...-ws/src/main/java/sample/ws/endpoint/HolidayEndpoint.java
+2
-0
HumanResourceService.java
...src/main/java/sample/ws/service/HumanResourceService.java
+2
-0
StubHumanResourceService.java
...main/java/sample/ws/service/StubHumanResourceService.java
+2
-0
SampleWsApplicationTests.java
...-ws/src/test/java/sample/ws/SampleWsApplicationTests.java
+11
-1
No files found.
spring-boot-samples/pom.xml
View file @
f0c0f000
spring-boot-samples/spring-boot-sample-ws/README.adoc
View file @
f0c0f000
...
...
@@ -3,7 +3,7 @@
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 gui
l
de.
in the Spring Web Services reference guide.
The sample uses Maven. It can be built and run from the command line:
...
...
spring-boot-samples/spring-boot-sample-ws/src/main/java/sample/ws/SampleWsApplication.java
View file @
f0c0f000
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
ws
;
import
org.springframework.boot.SpringApplication
;
...
...
@@ -28,4 +29,5 @@ public class SampleWsApplication {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
SpringApplication
.
run
(
SampleWsApplication
.
class
,
args
);
}
}
spring-boot-samples/spring-boot-sample-ws/src/main/java/sample/ws/WebServiceConfig.java
View file @
f0c0f000
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
ws
;
import
org.springframework.boot.context.embedded.ServletRegistrationBean
;
...
...
@@ -52,4 +53,5 @@ public class WebServiceConfig extends WsConfigurerAdapter {
public
XsdSchema
countriesSchema
()
{
return
new
SimpleXsdSchema
(
new
ClassPathResource
(
"META-INF/schemas/hr.xsd"
));
}
}
spring-boot-samples/spring-boot-sample-ws/src/main/java/sample/ws/endpoint/HolidayEndpoint.java
View file @
f0c0f000
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
ws
.
endpoint
;
import
java.text.SimpleDateFormat
;
...
...
@@ -76,4 +77,5 @@ public class HolidayEndpoint {
this
.
humanResourceService
.
bookHoliday
(
startDate
,
endDate
,
name
);
}
}
spring-boot-samples/spring-boot-sample-ws/src/main/java/sample/ws/service/HumanResourceService.java
View file @
f0c0f000
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
ws
.
service
;
import
java.util.Date
;
...
...
@@ -20,4 +21,5 @@ import java.util.Date;
public
interface
HumanResourceService
{
void
bookHoliday
(
Date
startDate
,
Date
endDate
,
String
name
);
}
spring-boot-samples/spring-boot-sample-ws/src/main/java/sample/ws/service/StubHumanResourceService.java
View file @
f0c0f000
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
ws
.
service
;
import
java.util.Date
;
...
...
@@ -31,4 +32,5 @@ public class StubHumanResourceService implements HumanResourceService {
this
.
logger
.
info
(
"Booking holiday for [{} - {}] for [{}] "
,
startDate
,
endDate
,
name
);
}
}
spring-boot-samples/spring-boot-sample-ws/src/test/java/sample/ws/SampleWsApplicationTests.java
View file @
f0c0f000
...
...
@@ -21,21 +21,29 @@ import javax.xml.transform.stream.StreamResult;
import
javax.xml.transform.stream.StreamSource
;
import
org.junit.Before
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.test.IntegrationTest
;
import
org.springframework.boot.test.OutputCapture
;
import
org.springframework.boot.test.SpringApplicationConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.web.WebAppConfiguration
;
import
org.springframework.ws.client.core.WebServiceTemplate
;
import
static
org
.
hamcrest
.
Matchers
.
containsString
;
import
static
org
.
junit
.
Assert
.
assertThat
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringApplicationConfiguration
(
classes
=
SampleWsApplication
.
class
)
@WebAppConfiguration
@IntegrationTest
public
class
SampleWsApplicationTests
{
@Rule
public
OutputCapture
output
=
new
OutputCapture
();
private
WebServiceTemplate
webServiceTemplate
=
new
WebServiceTemplate
();
@Value
(
"${local.server.port}"
)
...
...
@@ -65,5 +73,7 @@ public class SampleWsApplicationTests {
StreamResult
result
=
new
StreamResult
(
System
.
out
);
this
.
webServiceTemplate
.
sendSourceAndReceiveToResult
(
source
,
result
);
assertThat
(
this
.
output
.
toString
(),
containsString
(
"Booking holiday for"
));
}
}
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