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 Vl...@mapinfo.com on 2003/03/31 18:03:25 UTC

attribute reference

Hi there,

I'm not sure that is a bug or not. Could you please look through the
following:

<attribute name="code" type="myNS:codeType" />

<simpleType name="codeType">
      <restriction base="string" />
</simpleType>

<complexType name="someComplexType">
      <attribute ref="myNS:code" use="required" minOccurs="0" />
</complexType>

In this case WSDL2Java tool doesn't create member field for referenced
attribute. However it works fine for <element ref=>
Dump of Symbol Table doesn't contain any entry for "code" attribute.

I found the following inside of method addTypes() (SymbolTable class) for
element:

                // Create a type representing an element.  (This may
                // seem like overkill, but is necessary to support ref=
                // and element=.
                createTypeFromDef(node, true, level > SCHEMA_LEVEL);

At the same time attribute reference works if we call this method for
attribute as well (else if (isXSD && localPart.equals("attribute")) ...)
and entry for "code" is successfully created:

Symbol Table
-----------------------
org.apache.axis.wsdl.symbolTable.DefinedType
QName:         {http://myNS}codeType
name:          null
isReferenced?  true
Class:         org.apache.axis.wsdl.symbolTable.DefinedType
Base?:         false
Undefined?:    false
isSimpleType?  true
Node:          [simpleType: null]
Dims:
RefType:       null

org.apache.axis.wsdl.symbolTable.DefinedElement
QName:         {http://myNS}code
name:          null
isReferenced?  true
Class:         org.apache.axis.wsdl.symbolTable.DefinedElement
Base?:         false
Undefined?:    false
isSimpleType?  false
Node:          [attribute: null]
Dims:
RefType:
  QName:         {http://myNS}codeType
  name:          null
  isReferenced?  true
  Class:         org.apache.axis.wsdl.symbolTable.DefinedType
  Base?:         false
  Undefined?:    false
  isSimpleType?  true
  Node:          [simpleType: null]
  Dims:
  RefType:       null

org.apache.axis.wsdl.symbolTable.BaseType
QName:         {http://www.w3.org/2001/XMLSchema}string
name:          null
isReferenced?  true
Class:         org.apache.axis.wsdl.symbolTable.BaseType
Base?:         true
Undefined?:    false
isSimpleType?  false
Node:          null
Dims:
RefType:       null

org.apache.axis.wsdl.symbolTable.DefinedType
QName:         {http://myNS}someComplexType
name:          null
isReferenced?  true
Class:         org.apache.axis.wsdl.symbolTable.DefinedType
Base?:         false
Undefined?:    false
isSimpleType?  false
Node:          [complexType: null]
Dims:
RefType:       null

I didn't have much time to look what should be in symbol table, but it
seems there is no difference between <element ref=> and <attribute ref=>
from this point of view.
Thanks a lot for any comments.

Best regards,
Vladimir.