I am trying to create client project from WSDL file using Axis 1.4 (I don't have other choices, even cannot use Axis 2) and getting following error. Can any one suggest me how can I resolve it? The WSDL file is provided by vendor.
org.apache.axis.wsdl.toJava.DuplicateFileException: Duplicate file name: C:\Documents and Settings\My Documents\CalculateTax\com\NewProj\CompanyCodeType.java.
Hint: you may have mapped two namespaces with elements of the same name to the same package name.
at org.apache.axis.wsdl.toJava.JavaWriter.generate(JavaWriter.java:110)
at org.apache.axis.wsdl.toJava.JavaBeanWriter.generate(JavaBeanWriter.java:1405)
at org.apache.axis.wsdl.toJava.JavaTypeWriter.generate(JavaTypeWriter.java:113)
at org.apache.axis.wsdl.toJava.JavaGeneratorFactory$Writers.generate(JavaGeneratorFactory.java:421)
at org.apache.axis.wsdl.gen.Parser.generateTypes(Parser.java:547)
at org.apache.axis.wsdl.gen.Parser.generate(Parser.java:432)
at org.apache.axis.wsdl.gen.Parser.access$000(Parser.java:45)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:362)
at java.lang.Thread.run(Unknown Source)
The issue happens when you try to generate java client using a wsdl with same element names. Please change the element names and try. Otherwise you can use the eclipse tool for generating java client. It will automatically detect the same element names and create separate packages for the same. To generate java client using Eclipse : Right click on wsdl file > Web Services > Generate Client. This should help you.
you don't have to use Axis 2.
For example, if you have a part of wsdl like this:
This is a legal WSDL definition but Axis is failed. You can fix this problem with renaming complexTypes. For above example:
The point is when you write a name of complexType as "PascalCase", it conflicts with another one!
The Axis 1.4 bug description is (https://issues.apache.org/jira/browse/AXIS-2606)
Thus you can solve this by leaving out the optional parameter
... and it will generate your WSDL classes without errors. You can refactor them later if necessary.