1. 首先创建springboot工程
2. pom.xml中添加cxf支持
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxrs</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
3. 接口代码
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService
public interface DemoService {
@WebMethod
String sayHello(String name);
}
4. 接口实现类代码
import com.zzzy.server.DemoService;