Skip to content

Commit 5f770a2

Browse files
committed
3.4.0
1 parent d8a2764 commit 5f770a2

File tree

11 files changed

+142
-9
lines changed
  • solon-jakarta-projects
    • solon-boot
      • solon-boot-jetty-add-jsp-jakarta
      • solon-boot-jetty-jakarta
      • solon-boot-undertow-add-jsp-jakarta
      • solon-boot-undertow-jakarta
    • solon-data/hibernate-jakarta-solon-plugin
    • solon-logging/solon-logging-logback-jakarta
    • solon-render/solon-view-jsp-jakarta
    • solon-web

11 files changed

+142
-9
lines changed

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.noear</groupId>
99
<artifactId>solon-parent</artifactId>
10-
<version>3.3.3</version>
10+
<version>3.4.0</version>
1111
<relativePath />
1212
</parent>
1313

@@ -31,5 +31,6 @@
3131
<module>solon-jakarta-projects/solon-render/solon-view-jsp-jakarta</module>
3232

3333
<module>solon-jakarta-projects/solon-web/solon-web-servlet-jakarta</module>
34+
<module>solon-jakarta-projects/solon-web/solonx-web-webservices-jakarta</module>
3435
</modules>
3536
</project>

solon-jakarta-projects/solon-boot/solon-boot-jetty-add-jsp-jakarta/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.noear</groupId>
99
<artifactId>solon-parent</artifactId>
10-
<version>3.3.3</version>
10+
<version>3.4.0</version>
1111
<relativePath />
1212
</parent>
1313

solon-jakarta-projects/solon-boot/solon-boot-jetty-jakarta/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.noear</groupId>
99
<artifactId>solon-parent</artifactId>
10-
<version>3.3.3</version>
10+
<version>3.4.0</version>
1111
<relativePath />
1212
</parent>
1313

solon-jakarta-projects/solon-boot/solon-boot-undertow-add-jsp-jakarta/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.noear</groupId>
99
<artifactId>solon-parent</artifactId>
10-
<version>3.3.3</version>
10+
<version>3.4.0</version>
1111
<relativePath />
1212
</parent>
1313

solon-jakarta-projects/solon-boot/solon-boot-undertow-jakarta/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.noear</groupId>
99
<artifactId>solon-parent</artifactId>
10-
<version>3.3.3</version>
10+
<version>3.4.0</version>
1111
<relativePath />
1212
</parent>
1313

solon-jakarta-projects/solon-data/hibernate-jakarta-solon-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.noear</groupId>
99
<artifactId>solon-parent</artifactId>
10-
<version>3.3.3</version>
10+
<version>3.4.0</version>
1111
<relativePath />
1212
</parent>
1313

solon-jakarta-projects/solon-logging/solon-logging-logback-jakarta/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.noear</groupId>
99
<artifactId>solon-parent</artifactId>
10-
<version>3.3.3</version>
10+
<version>3.4.0</version>
1111
<relativePath/>
1212
</parent>
1313

solon-jakarta-projects/solon-render/solon-view-jsp-jakarta/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.noear</groupId>
99
<artifactId>solon-parent</artifactId>
10-
<version>3.3.3</version>
10+
<version>3.4.0</version>
1111
<relativePath />
1212
</parent>
1313

solon-jakarta-projects/solon-web/solon-web-servlet-jakarta/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.noear</groupId>
99
<artifactId>solon-parent</artifactId>
10-
<version>3.3.3</version>
10+
<version>3.4.0</version>
1111
<relativePath />
1212
</parent>
1313

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
动手前,先添加 Solon WebServices 插件(暂未发布):
2+
3+
```xml
4+
<dependency>
5+
<groupId>org.noear</groupId>
6+
<artifactId>solonx-webservices</artifactId>
7+
</dependency>
8+
```
9+
10+
11+
### 1、服务端示例
12+
13+
服务端需要与 solon.boot.jetty、solon.boot.unertow 或者 war 部署方式,配合使用。
14+
15+
* 添加配置(指定 web service 路径段)
16+
17+
```yaml
18+
server.webservices.path: "/ws/" #默认为 ws
19+
```
20+
21+
* 添加服务代码
22+
23+
```java
24+
public class ServerTest {
25+
public static void main(String[] args) {
26+
Solon.start(ServerTest.class, args);
27+
}
28+
29+
@WebService(serviceName = "HelloService", targetNamespace = "http://demo.solon.io")
30+
public static class HelloServiceImpl {
31+
public String hello(String name) {
32+
return "hello " + name;
33+
}
34+
}
35+
}
36+
```
37+
38+
启动后,可以通过 `http://localhost:8080/ws/HelloService?wsdl` 查看 wsdl 信息。
39+
40+
### 2、客户端示例
41+
42+
* 手写模式
43+
44+
```java
45+
public class ClientTest {
46+
public static void main(String[] args) {
47+
String wsAddress = "http://localhost:8080/ws/HelloService";
48+
HelloService helloService = WebServiceHelper.createWebClient(wsAddress, HelloService.class);
49+
50+
System.out.println("rst::" + helloService.hello("noear"));
51+
}
52+
53+
@WebService(serviceName = "HelloService", targetNamespace = "http://demo.solon.io")
54+
public interface HelloService {
55+
@WebMethod
56+
String hello(String name);
57+
}
58+
}
59+
```
60+
61+
* 容器模式
62+
63+
使用 `@WebServiceReference` 注解,直接注入服务。
64+
65+
```java
66+
//定义测试控制器
67+
@Controller
68+
public static class DemoController {
69+
@WebServiceReference("http://localhost:8080/ws/HelloService")
70+
private HelloService helloService;
71+
72+
@Mapping("/test")
73+
public String test() {
74+
return helloService.hello("noear");
75+
}
76+
}
77+
78+
//配置 WebService 接口
79+
@WebService(serviceName = "HelloService", targetNamespace = "http://demo.solon.io")
80+
public interface HelloService {
81+
@WebMethod
82+
String hello(String name);
83+
}
84+
85+
//启动 Solon
86+
public class ClientTest {
87+
public static void main(String[] args) {
88+
Solon.start(ClientTest2.class, args);
89+
}
90+
}
91+
```

0 commit comments

Comments
 (0)