欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

CXF自动生成wsdl与xsd文件

程序员文章站 2022-07-09 18:17:04
...

 

 针对maven2项目

 //把该内容直接拷贝到pom.xml里面,然后运行项目Run As ——>maven package

 

 

<!--导入cxf版本定义 -->

<properties>

<cxf.version>2.4.2</cxf.version>

</properties>

<build设置>

<build>

    <outputDirectory>webapp/WEB-INF/classes</outputDirectory>     //输出目录

<plugins>

<plugin>

<groupId>org.apache.cxf</groupId>

<artifactId>cxf-java2ws-plugin</artifactId>

<version>${cxf.version}</version>

<dependencies>

<dependency>

<groupId>org.apache.cxf</groupId>

<artifactId>cxf-rt-frontend-jaxws</artifactId>

<version>${cxf.version}</version>

</dependency>

<dependency>

<groupId>org.apache.cxf</groupId>

<artifactId>cxf-rt-frontend-simple</artifactId>

<version>${cxf.version}</version>

</dependency>

</dependencies>

 

<executions>

<execution>

<id>process-classes</id>

<phase>process-classes</phase>

<configuration>

<className>

com.incesoft.commbank.smsservice.SmsSendServiceImpl    //要生成的接口(接口与实现类都一样)的全类名

</className>

<genWsdl>true</genWsdl>

<verbose>true</verbose>

<argline>-createxsdimports</argline>

</configuration>

<goals>

<goal>java2ws</goal>

</goals>

</execution>

</executions>

</plugin>

</plugins>

</build>