axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sagara Gunathunga (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AXIS2-5258) The WSDL2Java ADB binding doesn't take namespace into account
Date Mon, 05 Mar 2012 17:15:58 GMT

    [ https://issues.apache.org/jira/browse/AXIS2-5258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13222453#comment-13222453
] 

Sagara Gunathunga  commented on AXIS2-5258:
-------------------------------------------

Above observation is correct but we have to allow this class's simple name duplication only
if unpack (-u) option is provided not un-wrapping (-uw) option. Unpack (-u) option facilitate
to have separate classes along with packages hence duplication of class name (simple name)
possible. 
                
> The WSDL2Java ADB binding doesn't take namespace into account
> -------------------------------------------------------------
>
>                 Key: AXIS2-5258
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5258
>             Project: Axis2
>          Issue Type: Bug
>          Components: adb
>            Reporter: Martin Steiger
>            Assignee: Sagara Gunathunga 
>         Attachments: JavaBeanWriter.java.patch, my.wsdl
>
>
> 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)
>       + WRAPPED_DATABINDING_CLASS_NAME;
>     }
>     else if (writeClasses)
>     {
>       packagePrefix = packageName;
>     }
>     String className = null;
>     if (!this.packageNameToClassNamesMap.containsKey(packagePrefix ))
>     {
>       this.packageNameToClassNamesMap.put(packagePrefix , new ArrayList());
>     }
>     List listOfNames = (List) this.packageNameToClassNamesMap.get(packagePrefix );
>     className = makeUniqueJavaClassName(listOfNames, originalName);
>     String fullyqualifiedClassName;
>     if (packagePrefix != null)
>     {
>       fullyqualifiedClassName = packagePrefix
>                     + (packagePrefix.endsWith(".") ? "" : ".") + className;
>     }
>     else
>     {
>       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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Mime
View raw message