I'm facing a problem when integrating a third party web service. I receive the following error: [ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.4.2:wsdl2java (generate-sources) on project pcm_portal: Thrown by JAXB: 'string15' is already defined at line 305 column 2 of schema ... -> [Help 1]
Actually I understand the error, this file contains severall schemas for the same target namespace and we can find the same simpleType (string15) defined in both schemas.
It's something like this:
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://siebel.com/CustomUI" ...>
<types>
<!-- ... -->
<xsd:schema elementFormDefault="qualified"
attributeFormDefault="unqualified"
targetNamespace="http://myNs/"
xmlns:xsdLocal3="http://myNs/">
<!-- ... -->
<xsd:simpleType name="string15">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="15"></xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
<!-- ... -->
</xsd:schema>
<!-- ... -->
<xsd:schema elementFormDefault="qualified"
attributeFormDefault="unqualified"
targetNamespace="http://myNs/"
xmlns:xsdLocal3="http://myNs/">
<!-- ... -->
<xsd:simpleType name="string15">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="15"></xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
<!-- ... -->
</xsd:schema>
<!-- ... -->
</types>
</definitions>
My question is
1) is there a way to allow wsdl2java to deal with such a file?
Today I'm using it via maven cxf-codegen-plugin and it is configured with this:
<defaultOptions>
<extraargs>
<extraarg>-exsh</extraarg>
<extraarg>true</extraarg>
<extraarg>-xjc-npa</extraarg>
</extraargs>
</defaultOptions>
2) If not does anybody knows a reference document that could be an argument for me since the team that gave me the wsdl say that there is no problem (indeed SoapUI makes no trouble with this WSDL)?