You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Emulator <em...@gmail.com> on 2016/04/14 05:14:21 UTC

Behavior of wsdl2java between 3.0.1, 3.0.9 and 3.1.6

Hi guys,
    I had a little experience on 3.0.1 and built a program by using
wsdl2java to generate java class. And I back again, use CXF on another
project, wish to keep them updated to 3.1.6.
    I use 3.1.6 to generate java class as following:
    ~/bin/apache-cxf-3.1.6/bin/wsdl2java -p tool.ws -client -impl -d
output.3.1.6 AGivenDef.wsdl
    but failed as "A class/interface with the same name
"com.aitc.test.DataSimple" is already in use. Use a class customization or
the -autoNameResolution option to resolve this conflict."
    I tried to use:
    ~/bin/apache-cxf-3.1.6/bin/wsdl2java  -autoNameResolution -p tool.ws
-client -impl -d output.3.1.6 AGivenDef.wsdl    
    but "Two declarations cause a collision in the ObjectFactory class."
error still happened.

    After some testing, I dropped the package parameter, it works:
    ~/bin/apache-cxf-3.1.6/bin/wsdl2java  -client -impl -d output.3.1.6
AGivenDef.wsdl    
    Generate codes just without package name.

    Then I tried to use 3.0.9, get exactly the same result as 3.1.6.

    I go back to use 3.0.1, use the first line:
    ~/bin/apache-cxf-3.0.1/bin/wsdl2java -p tool.ws -client -impl -d
output.3.0.1 AGivenDef.wsdl
    It successfully generated codes with package tool.ws


    I google some about "Two declarations cause a collision in the
ObjectFactory class." but they are not related to package parameter.

    I want know the reason, or how to adjust my parameter in 3.0.9/3.1.6. Or
Can I use the code generated by 3.0.1 in later version?



Regards.





--
View this message in context: http://cxf.547215.n5.nabble.com/Behavior-of-wsdl2java-between-3-0-1-3-0-9-and-3-1-6-tp5767839.html
Sent from the cxf-user mailing list archive at Nabble.com.