axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Fassler (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Created: (AXIS-2476) Multiple java or javax types not generated as AnyType in wsdl
Date Fri, 12 May 2006 16:02:08 GMT
Multiple java or javax types not generated as AnyType in wsdl
-------------------------------------------------------------

         Key: AXIS-2476
         URL: http://issues.apache.org/jira/browse/AXIS-2476
     Project: Apache Axis
        Type: Bug

  Components: WSDL processing  
    Versions: 1.4    
    Reporter: Jeff Fassler
    Priority: Minor


.java and .javax classes are supposed to be defined in wsdl documents as AnyType.  This works
for the first of any given .java or .javax class, but subsequent appearances of the same type
are not defined as AnyType, but are instead defines as their original type.

A class has three java.sql.timestamp members:
java.sql.Timestamp startTimestamp;
java.sql.Timestamp endTimestamp;
java.sql.Timestamp lastChangedTimestamp;

when java2wsdl is run, the first one is translated correctly, but subsequent ones are not:
<element name="startTimestamp" nillable="true" type="xsd:anyType"/>
<element name="endTimestamp" nillable="true" type="tns7:Timestamp"/>
<element name="lastChangedTimestamp" nillable="true" type="tns7:Timestamp"/>

A workaround is to replace the following code in Types.makeTypeElement:

        if (!addToTypesList(qName) && !anonymous) {
            if (containingElement != null) {
                containingElement.setAttribute("type", getQNameString(qName));
            }

            return true;
        }

with:

    String namespaceUri = qName.getNamespaceURI();
    String lastSixCharsOfUri = namespaceUri.substring(namespaceUri.length() - 6, namespaceUri.length());
    String lastFiveCharsOfUri = namespaceUri.substring(namespaceUri.length() - 5, namespaceUri.length());
   
    if (!addToTypesList(qName) && !anonymous && !lastSixCharsOfUri.equals(".javax")
&& !lastFiveCharsOfUri.equals(".java")) {
            if (containingElement != null) {
                containingElement.setAttribute("type", getQNameString(qName));
            }
            return true;
      }

it works correctly (though a bit kludgy).

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message