Skip to content

Commit c269671

Browse files
author
YunaiV
committed
开始 WebService 入门示例
1 parent 1bcc788 commit c269671

File tree

6 files changed

+135
-0
lines changed

6 files changed

+135
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>lab4-64-spring-ws-demo</artifactId>
7+
<groupId>cn.iocoder.springboot.labs</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>lab-65-spring-ws-demo-user-service</artifactId>
13+
14+
<properties>
15+
<!-- 依赖相关配置 -->
16+
<spring.boot.version>2.2.4.RELEASE</spring.boot.version>
17+
<!-- 插件相关配置 -->
18+
<maven.compiler.target>1.8</maven.compiler.target>
19+
<maven.compiler.source>1.8</maven.compiler.source>
20+
</properties>
21+
22+
<dependencyManagement>
23+
<dependencies>
24+
<dependency>
25+
<groupId>org.springframework.boot</groupId>
26+
<artifactId>spring-boot-starter-parent</artifactId>
27+
<version>${spring.boot.version}</version>
28+
<type>pom</type>
29+
<scope>import</scope>
30+
</dependency>
31+
</dependencies>
32+
</dependencyManagement>
33+
34+
<dependencies>
35+
<!-- 引入 Spring Boot 基础 Starter 依赖 -->
36+
<dependency>
37+
<groupId>org.springframework.boot</groupId>
38+
<artifactId>spring-boot-starter</artifactId>
39+
</dependency>
40+
</dependencies>
41+
42+
43+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package cn.iocoder.springboot.lab65.userservice;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
6+
import java.util.concurrent.CountDownLatch;
7+
8+
@SpringBootApplication
9+
public class UserServiceApplication {
10+
11+
public static void main(String[] args) throws InterruptedException {
12+
// 启动 Spring Boot 应用
13+
SpringApplication.run(UserServiceApplication.class, args);
14+
// 阻塞,避免应用退出
15+
new CountDownLatch(1).await();
16+
}
17+
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://spring.io/guides/gs-producing-web-service"
2+
targetNamespace="http://spring.io/guides/gs-producing-web-service" elementFormDefault="qualified">
3+
4+
<xs:element name="getCountryRequest">
5+
<xs:complexType>
6+
<xs:sequence>
7+
<xs:element name="name" type="xs:string"/>
8+
</xs:sequence>
9+
</xs:complexType>
10+
</xs:element>
11+
12+
<xs:element name="getCountryResponse">
13+
<xs:complexType>
14+
<xs:sequence>
15+
<xs:element name="country" type="tns:country"/>
16+
</xs:sequence>
17+
</xs:complexType>
18+
</xs:element>
19+
20+
<xs:complexType name="country">
21+
<xs:sequence>
22+
<xs:element name="name" type="xs:string"/>
23+
<xs:element name="population" type="xs:int"/>
24+
<xs:element name="capital" type="xs:string"/>
25+
<xs:element name="currency" type="tns:currency"/>
26+
</xs:sequence>
27+
</xs:complexType>
28+
29+
<xs:simpleType name="currency">
30+
<xs:restriction base="xs:string">
31+
<xs:enumeration value="GBP"/>
32+
<xs:enumeration value="EUR"/>
33+
<xs:enumeration value="PLN"/>
34+
</xs:restriction>
35+
</xs:simpleType>
36+
</xs:schema>

lab-65/lab-65-spring-ws-demo/pom.xml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>lab-65</artifactId>
7+
<groupId>cn.iocoder.springboot.labs</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>lab4-64-spring-ws-demo</artifactId>
13+
<packaging>pom</packaging>
14+
<modules>
15+
<module>lab-65-spring-ws-demo-user-service</module>
16+
</modules>
17+
18+
19+
</project>

lab-65/pom.xml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>labs-parent</artifactId>
7+
<groupId>cn.iocoder.springboot.labs</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>lab-65</artifactId>
13+
<packaging>pom</packaging>
14+
<modules>
15+
<module>lab4-64-spring-ws-demo</module>
16+
</modules>
17+
18+
</project>

pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
<!-- <module>labx-28</module>-->
109109
<!-- <module>labx-29</module>-->
110110
<!-- <module>labx-30</module>-->
111+
<module>lab-65</module>
111112
</modules>
112113

113114
</project>

0 commit comments

Comments
 (0)