Background: We are developing an application that communicates with several 3rd party webservices. Sadly, one of them has defined a WSDL file using poor naming conventions. The same names are often re-used for a response element, and the complexType that it employs. The code snipped below shows one such occurrence as an example:
<s:element name="Reset_PasswordResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Reset_PasswordResult" type="tns:ResetPasswordResponse" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ResetPasswordResponse">
<s:complexContent mixed="false">
<s:extension base="tns:BaseResponse" />
</s:complexContent>
</s:complexType>
We use Maven cxf codegen plugin (jaxb/jax-ws) to compile this to Java classes. To avoid the name clashes, we have formerly used the option -AutoNameResolution. However, we have found that this leads to unexpected results, where on some machines one class gets renamed to ResetPasswordResponse2.java, while on other machines the other class is renamed. This makes collaborative development very difficult, and also gives us worries for the future (what if it won't compile correctly on Jenkins at some point?)
Question: I am looking for a way to manually determine how the translation/renaming should take place.
- I am told that simply changing the names in the WSDL will not work, because the xml naming annotations in the Java files are of importance.
- I have also looked into binding files or inline binding statements, but cannot get it to work. The documentation at http://wiki.netbeans.org/WsdlCustomizer#Class_Customization seems to imply that name changes are only possible for "wsdl:portType, wsdl:fault, soap:headerfault, and wsdl:server", which indicates I might be trying to do something that is simply impossible.
Are jaxb/jax-ws bindings a possible solution? Are there other options?