您好,欢迎来到叨叨游戏网。
搜索
您的当前位置:首页webservice与springboot整合

webservice与springboot整合

来源:叨叨游戏网

1、pom.xml

<!-- cxf支持 -->
          <dependency>
              <groupId>org.apache.cxf</groupId>
              <artifactId>cxf-rt-frontend-jaxws</artifactId>
             <version>3.1.6</version>
          </dependency>
          <dependency>
              <groupId>org.apache.cxf</groupId>
              <artifactId>cxf-rt-transports-http</artifactId>
             <version>3.1.6</version>
         </dependency>

因为项目中使用的springboot版本很老。所以没有使用cxf和springboot整合包

<!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-spring-boot-starter-jaxws -->
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-spring-boot-starter-jaxws</artifactId>
    <version>3.3.2</version>
</dependency>
2、贴代码

webServiceConfig.java

webService中接口的实现类

webService中接口

注意:接口中的targetNamespace一定要与实现类中的targetNamespace一致

如果想修改webservice样式可以使用@SOAPBinding注解进行修改。可以参考:

https://my.oschina.net/u/3358860/blog/3052244

如果想添加注释可以使用@WSDLDocumentation

如果想在报文中改变参数名称可以使用注解@WebParam

转载于:https://my.oschina.net/u/3358860/blog/3052252

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- gamedaodao.net 版权所有 湘ICP备2024080961号-6

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务