版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_39470733/article/details/86492361
直接撸代码:
1.创建一个小的maven项目
2.引入cxf的插件依赖:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>test</artifactId>
<groupId>test</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>type-generator</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<cxf.version>3.2.6</cxf.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<encoding>UTF-8</encoding>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<defaultOptions>
<extraargs>
<extraarg>-impl</extraarg>
<extraarg>-verbose</extraarg>
<extraarg>-validate</extraarg>
<extraarg>-client</extraarg>
</extraargs>
</defaultOptions>
<wsdlOptions>
<wsdlOption>
<wsdl>http://0.0.0.0:8080/services/getWeatherService?wsdl</wsdl>
<!--<wsdl>src/main/resources/r01991000000091/wsdl/call.wsdl</wsdl>-->
<extraargs>
<extraarg>-p</extraarg>
<extraarg>xxx.xxx.xxx.xxx.xxx</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
<!--<dependencies>-->
<!--<dependency>-->
<!--<groupId>org.apache.axis</groupId>-->
<!--<artifactId>axis</artifactId>-->
<!--<version>1.4</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.apache.axis</groupId>-->
<!--<artifactId>axis-jaxrpc</artifactId>-->
<!--<version>1.4</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>commons-logging</groupId>-->
<!--<artifactId>commons-logging</artifactId>-->
<!--<version>1.2</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>commons-discovery</groupId>-->
<!--<artifactId>commons-discovery</artifactId>-->
<!--<version>0.5</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>axis</groupId>-->
<!--<artifactId>axis-wsdl4j</artifactId>-->
<!--<version>1.5.1</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.apache.axis</groupId>-->
<!--<artifactId>axis-saaj</artifactId>-->
<!--<version>1.4</version>-->
<!--</dependency>-->
<!--<!– activation+mail: To stop Axis generating WARNING about "Attachment support being disabled" –>-->
<!--<dependency>-->
<!--<groupId>javax.activation</groupId>-->
<!--<artifactId>activation</artifactId>-->
<!--<version>1.1.1</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>javax.mail</groupId>-->
<!--<artifactId>mail</artifactId>-->
<!--<version>1.4.7</version>-->
<!--</dependency>-->
<!--</dependencies>-->
</plugin>
</plugins>
</build>
3.然后进行maven 编译 compile即可生成 target
如有披露或问题欢迎留言或者入群探讨