1

我正在使用cxf-codegen-plugin并尝试从 wsdl 生成 java。在我的 xsd 架构中,我有以下元素

<xsd:element name="SomeElement">
    <xsd:complexType>
        <xsd:attribute name="version" type="xsd:string" use="optional">
        </xsd:attribute>
        <xsd:attribute name="Version" type="xsd:string" use="optional">
        </xsd:attribute>
    </xsd:complexType>
</xsd:element>

CXF 尝试将这两个属性都生成到字段中version并抛出属性已经存在的异常。有没有办法生成 XML 中描述的属性?例如

protected String version;
protected String Version;

我知道,我可以定义绑定并重命名其中一个属性,但我有大约 100 个 wsdl,所以我不想为每个文件编写绑定。

我也尝试添加-autoNameResolution参数,但没有帮助。

4

0 回答 0