Uploaded image for project: 'Axis'
  1. Axis
  2. AXIS-2426

XMLType of Attribute and Element of same type isn't the same in generated class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.3
    • None
    • WSDL processing
    • None
    • jdk1.4.2, windows XP

    Description

      With the given schema,
      <simpleType name="serial">
      <restriction base="positiveInteger" />
      </simpleType>
      <complexType name="CardIdType">
      <choice>
      <element name="serial" type="impl:serial" />
      <element name="secretcode" type="int" />
      </choice>
      </complexType>
      <complexType name="CardType">
      <attribute name="serial" type="impl:serial" use="required" />
      <attribute name="group" type="string" use="required" />
      </complexType>

      CardIdType has an element of type serial and CardType has an attribute of type serial, in the generated class, the element 's xml type is set into ("http://www.w3.org/2001/XMLSchema", "positiveInteger") while the attribute
      's xml type is set into ("http://test.com", "serial").

      Code snippet from generated CardType.java
      typeDesc.setXmlType(new javax.xml.namespace.QName("http://test.com", "CardType"));
      org.apache.axis.description.AttributeDesc attrField = new org.apache.axis.description.AttributeDesc();
      attrField.setFieldName("serial");
      attrField.setXmlName(new javax.xml.namespace.QName("http://test.com", "serial"));
      attrField.setXmlType(new javax.xml.namespace.QName("http://test.com", "serial"));

      Code snippet from generated CardType.java
      typeDesc.setXmlType(new javax.xml.namespace.QName("http://test.com", "CardIdType"));
      org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
      elemField.setFieldName("serial");
      elemField.setXmlName(new javax.xml.namespace.QName("http://test.com", "serial"));
      elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "positiveInteger"));

      With these generated code; client can call the service successfully.
      While using the Java2WSDL to regenerate WSDL file from the generated java files, there will be an empty complex type in the generated WSDL. Run WSDL2Java with the regenerated WSDL file, java.lang.NullPointerException will be thrown.

      Is there any reason why the XML Type of Attribute and Element of the same type isn't the same in generated class.

      the attachement is full wsdl file to reproduce the problem.

      Attachments

        1. 2426_diff.txt
          0.6 kB
          qin bethune
        2. axis-2426.wsdl
          3 kB
          qin bethune

        Activity

          People

            Unassigned Unassigned
            bethune qin bethune
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: