【发布时间】:2016-05-19 04:44:07
【问题描述】:
我们正在使用axis2 来生成Web 服务客户端,(我现在后悔了!)。使用axis2命令行工具,您可以通过开关 -Euwc 将 int 包装成 Integer,将 boolean 包装成 Boolean 等等。这是告诉axis2其OK对于某些int或boolean值在架构中可以为空的一种方法。
我的问题是如何通过 POM 或其他方式使用 Maven 设置此参数以实现与生成的源相同的行为?我的 stackoverflow 和谷歌搜索并没有透露太多信息。有一个 Jira 问题,开发人员似乎在没有指明正确方向的情况下关闭了该问题。
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.futile.bizzareservice</groupId>
<artifactId>BizzareService</artifactId>
<version>2.0</version>
<name>BizzareService</name>
<properties>
<wsdl.location>unfortunate-wsdls</wsdl.location>
<axis2.version>1.5.4</axis2.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-wsdl2code-maven-plugin</artifactId>
<version>${axis2.version}</version>
<configuration>
<packageName>com.futile.bizzareservice.client</packageName>
<wsdlFile>${wsdl.location}/bizzareservice.wsdl</wsdlFile>
<language>java</language>
<databindingName>adb</databindingName>
<unpackClasses>true</unpackClasses>
</configuration>
<executions>
<execution>
<goals>
<goal>wsdl2code</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2</artifactId>
<version>${axis2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-adb</artifactId>
<version>${axis2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-adb-codegen</artifactId>
<version>${axis2.version}</version>
</dependency>
</dependencies>
</project>
在配置中将 unwrap 设置为 true 并没有帮助,因为它是一个不同的选项。我会在未来避免使用axis2,但暂时我们会坚持下去。
【问题讨论】:
标签: maven axis2 autoboxing wsdl2code