Maven CXF wsdl2Java List生成ArrayOfXxx包装对象 解决方法

时间:2025-04-02 17:38:07

添加-xjc-Xxew解决,同时还要给插件添加相应的jar包,如下:

<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<id>generate-sources-w2j</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>src/main/java</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}\src\main\resources\wsdl\20180628-OnePoint.svc-D11V2-single.wsdl</wsdl>
<extendedSoapHeaders>true</extendedSoapHeaders>
<autoNameResolution>true</autoNameResolution>
<bindingFiles>
<bindingFile>${basedir}\src\main\resources\wsdl\jaxb-bindings.xml</bindingFile>
</bindingFiles>
<extraargs>
<extraarg>-xjc-Xxew</extraarg>
<extraarg>-xjc-Xxew:summary
${basedir}\src\main\resources\wsdl\xew-summary-mystifly.txt
</extraarg>
<extraarg>-xjc-Xxew:instantiate lazy</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.github.jaxb-xew-plugin</groupId>
<artifactId>jaxb-xew-plugin</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>2.3.0.1</version>
</dependency>
</dependencies>
</plugin>

转载:https://*.com/questions/33667462/cxf-wsdl2java-listwrapper-in-wsdl-should-be-unwrapped