WSDL2Java won't resolve name clashes when -p is specified
---------------------------------------------------------
Key: AXIS-1775
URL: http://issues.apache.org/jira/browse/AXIS-1775
Project: Axis
Type: Bug
Environment: Axis 1.2 RC2
Reporter: Venkat Reddy
If the WSDL has same value for name attribute for both <service> and
<portType>, WSDL2Java with -p option results in DuplicateFileException.
C:\web_services>java org.apache.axis.wsdl.WSDL2Java -p com.test
GlobalWeather.wsdl
org.apache.axis.wsdl.toJava.DuplicateFileException: Duplicate file name:
com\test\GlobalWeather.java.
Hint: you may have mapped two namespaces with elements of the same name to the
same package name.
Cause: Namespaces.getCreate() simply returns default doesn't populate
pkg2NamespacesMap resulting in empty collisionCanidates in
JavaGeneratorFactory.resolveNameClashes(), and the java class names wont get
resolved, like when the -p option is not used.
Fix: add a call to put(key, defaultPackage) inside Namespaces.getCreate()
method to populate pkg2NamespacesMap even when the default package is used.
Result: WSDL2Java will use file names like GolbalWeather_Service.java
GolbalWeather_PortType.java instead of GlobaWeather.java, thus resolving name
conflicts when the -p is used. If -p is not used, it will work as usual.
Please let me know if this fix can potentially break something else.
Venkat
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira