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 "qin bethune (JIRA)" <ax...@ws.apache.org> on 2006/03/08 07:12:38 UTC

[jira] Created: (AXIS-2426) XMLType of Attribute and Element of same type isn't the same in generated class

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

         Key: AXIS-2426
         URL: http://issues.apache.org/jira/browse/AXIS-2426
     Project: Apache Axis
        Type: Bug
  Components: WSDL processing  
    Versions: 1.3    
 Environment: jdk1.4.2, windows XP
    Reporter: qin bethune


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. 
 


-- 
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


[jira] Updated: (AXIS-2426) XMLType of Attribute and Element of same type isn't the same in generated class

Posted by "qin bethune (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2426?page=all ]

qin bethune updated AXIS-2426:
------------------------------

    Attachment: 2426_diff.txt

fix for this bug.


> XMLType of Attribute and Element of same type isn't the same in generated class
> -------------------------------------------------------------------------------
>
>          Key: AXIS-2426
>          URL: http://issues.apache.org/jira/browse/AXIS-2426
>      Project: Apache Axis
>         Type: Bug
>   Components: WSDL processing
>     Versions: 1.3
>  Environment: jdk1.4.2, windows XP
>     Reporter: qin bethune
>  Attachments: 2426_diff.txt, axis-2426.wsdl
>
> 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. 
>  

-- 
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


[jira] Updated: (AXIS-2426) XMLType of Attribute and Element of same type isn't the same in generated class

Posted by "qin bethune (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2426?page=all ]

qin bethune updated AXIS-2426:
------------------------------

    Attachment: axis-2426.wsdl

wsdl file for reproducing.

> XMLType of Attribute and Element of same type isn't the same in generated class
> -------------------------------------------------------------------------------
>
>          Key: AXIS-2426
>          URL: http://issues.apache.org/jira/browse/AXIS-2426
>      Project: Apache Axis
>         Type: Bug
>   Components: WSDL processing
>     Versions: 1.3
>  Environment: jdk1.4.2, windows XP
>     Reporter: qin bethune
>  Attachments: axis-2426.wsdl
>
> 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. 
>  

-- 
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