【发布时间】:2010-12-13 13:41:22
【问题描述】:
我正在尝试在来自第 3 方的 WSDL 中执行 wsimport(通过 netbeans 6.9.1),但它在 JAXB 中不断生成此错误:
Two declarations cause a collision in the ObjectFactory class.
碰撞是关于这两件事的:
在messages.xsd中:
<xs:element name="PingRequest" nillable="true" type="tns:PingRequest" />
在 service.xsd 中:
<xs:element name="Ping">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q1="http://www.3rd-party-uri-here/messages/" minOccurs="0" name="request" nillable="true" type="q1:PingRequest" /> <!-- HERE! -->
</xs:sequence>
</xs:complexType>
</xs:element>
我在 stackoverflow 中看到 JAXB 无法处理两个不同元素具有相同名称或名称仅大写不同的情况。但是,在这种情况下,这两个元素实际上应该是相同的(第二个引用第一个)。那么,我该怎么办?
【问题讨论】:
-
你找到答案了吗?
-
@Cuga - 不,我从来没有找到答案。