Axis
  1. Axis
  2. AXIS-2426

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

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3
    • Fix Version/s: None
    • Component/s: WSDL processing
    • Labels:
      None
    • Environment:
      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.

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

        Activity

        qin bethune created issue -
        Hide
        qin bethune added a comment -

        wsdl file for reproducing.

        Show
        qin bethune added a comment - wsdl file for reproducing.
        qin bethune made changes -
        Field Original Value New Value
        Attachment axis-2426.wsdl [ 12323909 ]
        Hide
        qin bethune added a comment -

        fix for this bug.

        Show
        qin bethune added a comment - fix for this bug.
        qin bethune made changes -
        Attachment 2426_diff.txt [ 12323913 ]
        Mark Thomas made changes -
        Workflow jira [ 12351709 ] Default workflow, editable Closed status [ 12554743 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12554743 ] jira [ 12577193 ]

          People

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

            Dates

            • Created:
              Updated:

              Development