一、pom.xmljava
<!-- 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>web
由于项目中使用的springboot版本很老。因此没有使用cxf和springboot整合包spring
<!-- 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>
二、贴代码apache
webServiceConfig.javaspringboot
webService中接口的实现类frontend
webService中接口spring-boot
注意:接口中的targetNamespace必定要与实现类中的targetNamespace一致spa
若是想修改webservice样式可使用@SOAPBinding注解进行修改。能够参考:.net
https://my.oschina.net/u/3358860/blog/3052244xml
若是想添加注释可使用@WSDLDocumentation
若是想在报文中改变参数名称可使用注解@WebParam