We are trying to generate a Java SOAP client from to integrate with an external service. Since this is an external company, changes to the WSDL is not an option.
When trying to generate the client using the cxf-codegen-plugin Maven plugin, we get the following error:
Two declarations cause a collision in the ObjectFactory class.
The problem relates to the following declaration in the WSDL:
<s:element name="CallSomeMethod">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="GetSomeDataResult" type="tns:InterfaceReturnCode" />
<s:element minOccurs="0" maxOccurs="1" name="getSomeDataResult" type="tns:GetSomeDataResult" />
</s:sequence>
</s:complexType>
</s:element>
It's obvious to see where the issue is. My problem is, the WSDL seems to get imported fine by online generic SOAP clients, so it has to at least be valid. I have also read that generating the Java code without the -p
option will result in the generator creating separate packages, which should resolve the issue. But, how can I do this with the cxf-codegen-plugin Maven plugin?