wsimport - 两个声明导致冲突,给出相同的行
尝试用于为 SOAP 终结点生成客户端。WSDL 和所有使用的 XSD 文件都是本地副本。wsimport
这是正在执行的命令:
wsimport ./bwWsdl.xml -p com.generated -Xnocompile -d ../src -extension -keep -XadditionalHeaders -B-XautoNameResolution
这给出了这个错误:
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 16 of file:/schemas/newSchema.xsd
[ERROR] (Related to above error) This is the other declaration.
line 16 of file:/schemas/newSchema.xsd
请注意,报告的冲突的行号相同。
架构如下:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
version="2.004" id="OTA2003A2009A">
<xs:complexType name="TPA_ExtensionsType">
<xs:annotation>
<xs:documentation xml:lang="en">Description here.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any processContents="skip" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:element name="TPA_Extensions" type="TPA_ExtensionsType">
<xs:annotation>
<xs:documentation xml:lang="en">More description here.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
我尝试过删除类型定义,但它在很多其他地方被引用。
任何人都可以就如何使其工作提供任何建议吗?
谢谢
编辑:
下面是 WSDL 导入这些模式的行:
<definitions name='ResLookupGet' targetNamespace='http://org.jboss.ws/resLookupGet' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:http='http://schemas.xmlsoap.org/wsdl/http/' xmlns:mime='http://schemas.xmlsoap.org/wsdl/mime/' xmlns:ns='http://www.opentravel.org/OTA/2003/05/beta' xmlns:rq='http://www.opentravel.org/OTA/2003/05/betarq' xmlns:rs='http://www.opentravel.org/OTA/2003/05/betars' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.ws/resLookupGet' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<types>
<xsd:schema targetNamespace='http://org.jboss.ws/resLookupGet' xmlns:tns='http://org.jboss.ws/resLookupGet' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<xsd:import namespace='http://www.opentravel.org/OTA/2003/05/betarq' schemaLocation='./schemas/FooAffiliateHeaderRQ.xsd'/>
<xsd:import namespace='http://www.opentravel.org/OTA/2003/05/betarq' schemaLocation='./schemas/FooResLookupGetRQ.xsd'/>
<xsd:import namespace='http://www.opentravel.org/OTA/2003/05/betars' schemaLocation='./schemas/FooResLookupGetRS.xsd'/>
</xsd:schema>
</types>
<message name='ResLookupGetRQ'>
<part element='rq:FooResLookupGetRQ' name='FooResLookupGetRQ'></part>
</message>
<message name='ResLookupGetRS'>
<part element='rs:FooResLookupGetRS' name='FooResLookupGetRS'></part>
</message>