You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2002/11/13 17:05:52 UTC

DO NOT REPLY [Bug 14510] New: - Bug in .

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14510>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14510

Bug in <element ref="...">.

           Summary: Bug in <element ref="...">.
           Product: Axis
           Version: 1.0
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: WSDL processing
        AssignedTo: axis-dev@xml.apache.org
        ReportedBy: vladimir@nesterovsky-bros.com


I am trying to use Axis 1.0 for creating uddi client web service.
But I have found that Axis cannot handle uddi's wsdl file (version 2.0).

First of all it does not understand xsd:language type.
But it's ok. I have temporary changed attribute xml:lang of type
xsd:language to
attribute lang of type xsd:string and this allowed me to import files.

But the main thing I have found is that the Axis in some cases generates
not correct metadata. And this lead to incorrect behaviour at runtime.
In particular I have found that such construction:

...
<xsd:element name="authInfo" type="string"/>
...
<xsd:element name="authToken" type="uddi:authToken"/>
  <xsd:complexType name="authToken">
    <xsd:sequence>
      <xsd:element ref="uddi:authInfo"/> <!-- this construction is not
handled by Axis -->
    </xsd:sequence>
  <xsd:attribute name="generic" type="string" use="required"/>
  <xsd:attribute name="operator" type="string" use="required"/>
</xsd:complexType>
...

is mapped to metadata in the following way

public class AuthToken  implements java.io.Serializable {
...
    static {
        org.apache.axis.description.FieldDesc field = new
org.apache.axis.description.AttributeDesc();
        field.setFieldName("generic");
        field.setXmlName(new javax.xml.namespace.QName("", "generic"));
        field.setXmlType(new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        typeDesc.addFieldDesc(field);
        field = new org.apache.axis.description.AttributeDesc();
        field.setFieldName("operator");
        field.setXmlName(new javax.xml.namespace.QName("", "operator"));
        field.setXmlType(new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        typeDesc.addFieldDesc(field);
        field = new org.apache.axis.description.ElementDesc();
        field.setFieldName("authInfo");
        field.setXmlName(new
javax.xml.namespace.QName("urn:uddi-org:api_v2", "authInfo"));
        field.setXmlType(new
javax.xml.namespace.QName("urn:uddi-org:api_v2", "authInfo")); // <-- (1)
look at this
        typeDesc.addFieldDesc(field);
    };
...
}

As we see at line (1) authInfo is mapped to some xml type
QName("urn:uddi-org:api_v2", "authInfo").
But there is no such a type at all. In fact this leads to that the authInfo
field remains empty (null) at
runtime when object of type AuthToken is deserialized.
I suppose more correct code would be:

...
        field = new org.apache.axis.description.ElementDesc();
        field.setFieldName("authInfo");
        field.setXmlName(new
javax.xml.namespace.QName("urn:uddi-org:api_v2", "authInfo"));
        field.setXmlType(new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
...

In order to chage generation I have changed a little
SymbolTable.getTypeEntry method:

    /**
     * Get the type entry for the given qname.
     * @param qname
     * @param wantElementType boolean that indicates type or element (for
type= or ref=)
     */
    public TypeEntry getTypeEntry(QName qname, boolean wantElementType) {
        if (wantElementType)
        {
          // old lines begin
          return getElement(qname);
          // old lines end
          // my change begin
          Element elem=getElement(qname);

          return elem!=null ? elem.getRefType() : null;

          // my change end
        } else
            return getType(qname);
    } // getTypeEntry