• 使用 SpringBoot 集成 WebService [不需要身份验证]


    一、使用 JDK 自带的工具生成实体类

    # 格式
    wsimport -s 保存路径 -p 包路径 -encoding utf-8 wsdl文件地址
    # 实例
    wsimport -s d:wsdl -p cn.lqdev.webservice -encoding utf-8 http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx?wsdl

    二、将实体类导入到项目中

    /**
     * @Description: 客户端的相关调用配置
     * @Date: 2020/03/20
     */
    @Configuration
    public class WsClientConfig {
        /**
         * @Description: 返回一个 WebServiceSoap 对象
         * @Date: 2020/03/20
         */
        @Bean
        public XxWebServiceSoap getWebServiceSoap(){
            return new XxWebService().getXxWebServiceSoap();
        }
    }

    三、控制层调用

    /**
    
    - @Description:
    - @Date: 2020/03/20
      */
    
    @RestController
    @RequestMapping("/chenys")
    public class QQController {
        @Autowired
        private XxWebServiceSoap xxWebServiceSoap;
    
    @GetMapping("/QQfind/{QQNum}")
    public String xxResponse(@PathVariable("QQNum") String QQNum) {
        String s = xxWebServiceSoap.qqCheckOnline(QQNum);
        return s;
    }
    
    }
  • 相关阅读:
    5,7地面物品
    0,1选怪
    0,2使用红,蓝
    BT地址(__)
    3,7包裹物品数组
    0,4捡物
    如何在目标内网中发现更多存活主机
    xss自动化攻击
    .NET Framework 4安装失败
    利用struts1.x框架需要注意的问题
  • 原文地址:https://www.cnblogs.com/damaoa/p/12763334.html
Copyright © 2020-2023  润新知