【发布时间】:2021-06-25 09:31:14
【问题描述】:
我正在开发一个基于 wsdl 的 Web 服务实现。 在链接到 wsdl 的 xsd 中有一个复杂的选择,如下所示:
<xs:sequence>
<xs:choice>
<xs:element name="BinaryTerm" type="TermType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<xs:element name="BinaryExpression" type="ExpressionType"/>
</xs:choice>
<xs:element name="Operator" type="SimpleOperatorType"/>
<xs:choice>
<xs:element name="BinaryTerm" type="TermType"/>
<xs:element name="BinaryExpression" type="ExpressionType"/>
</xs:choice>
</xs:sequence>
每次生成类实现时,我都会获得一个类 ExpressionType,其中包含一个列表 由于重复名称 BinaryTerm 和 BinaryExpression 而导致的 JAXBElement。 我已经阅读了很多建议将 bindings.xml 与这些选项一起使用的线程:
<jaxb:globalBindings generateElementProperty="false" fixedAttributeAsConstantProperty="true" choiceContentProperty="true">
但我的 ExpressionType 类没有任何变化。 任何人都可以建议如何管理这个与 WSDL 相关的 XSD。 我无法更改这些定义文件。 谢谢,安德里亚
【问题讨论】:
标签: java web-services cxf collision wsdl2java