spring webflux 和 webservice 同一个工程

spring webflux 和 webservice 同一个工程,第1张

基于 SpringBoot 创建一个 SOAP WebService 服务的步骤

之前发布过在 springboot 中基于 jaxws 发布 WebService 的文章,是基于注解式的(cxf封装过的starter)。
本文是基于 webflux 框架下的代码工程中,用另外一种方式发布 webservice

1.初始化一个原始的 springboot 工程

创建一个基础的 springboot 工程,选择 webflux 方式(或者手工引入 webflux 依赖)。

    
        org.springframework.boot
        spring-boot-starter-webflux
    

创建一个 webflux 的 Controller,启动服务确定可以正常访问(http://localhost:8080/demo/show)。

@RequestMapping("/demo")
@RestController
public class DemoController {

    @RequestMapping(value = "/show")
    public Mono show() {
        return Mono.just(&

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/langs/904677.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-15
下一篇 2022-05-15

发表评论

登录后才能评论

评论列表(0条)

保存