axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Steiger (Created) (JIRA)" <>
Subject [jira] [Created] (AXIS2-5258) The WSDL2Java ADB binding doesn't take namespace into account
Date Fri, 02 Mar 2012 09:09:59 GMT
The WSDL2Java ADB binding doesn't take namespace into account

                 Key: AXIS2-5258
             Project: Axis2
          Issue Type: Bug
          Components: adb
            Reporter: Martin Steiger

I have 3 complex types defined with the same name, but they are in different namespaces. However,
when the ADB code is generated it still appends a unique counter to the end of the third class
name. This shouldn't be necessary since they are in different namespaces. 

With the fix of issue 3136, for the second type with the same name an "E" is appended instead
of the counter. But for the third type still the counter is applied.

The Problem seems to be that the package name is not taken in account as long as it isn't
a wrapped type.

I Fixed this by patching the method org.apache.axis2.schema.writer.JavaBeanWriter.makeFullyQualifiedClassName(QName)

The patch is based on Revision 606099

 public String makeFullyQualifiedClassName(QName qName)

    String namespaceURI = qName.getNamespaceURI();
    String packageName = getPackage(namespaceURI);
    String originalName = qName.getLocalPart();
    String packagePrefix = null;
    if (wrapClasses)
      packagePrefix = (this.packageName == null ? DEFAULT_PACKAGE + "." : this.packageName)
    else if (writeClasses)
      packagePrefix = packageName;

    String className = null;
    if (!this.packageNameToClassNamesMap.containsKey(packageName))
      this.packageNameToClassNamesMap.put(packageName, new ArrayList());
    List listOfNames = (List) this.packageNameToClassNamesMap.get(packageName);
    className = makeUniqueJavaClassName(listOfNames, originalName);

    String fullyqualifiedClassName;
    if (packagePrefix != null)
      fullyqualifiedClassName = packagePrefix
                    + (packagePrefix.endsWith(".") ? "" : ".") + className;
      fullyqualifiedClassName = className;
    // return the fully qualified class name
    return fullyqualifiedClassName;

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message