axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nick Sharman (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Created: (AXIS-1813) Incorrect treatment of ComplexTypes containing <choice>
Date Fri, 11 Feb 2005 16:11:12 GMT
Incorrect treatment of  ComplexTypes containing <choice>
--------------------------------------------------------

         Key: AXIS-1813
         URL: http://issues.apache.org/jira/browse/AXIS-1813
     Project: Axis
        Type: Bug
  Components: Serialization/Deserialization  
    Versions: current (nightly)    
    Reporter: Nick Sharman


Consider a request type of the form:

  <xs:complexType name="MIRStoreEntityRequestType">
    <xs:choice>
      <xs:element name="alt1" type="xx:Alt1"/>
      <xs:element name="alt2" type="xx:Alt2"/>
      <xs:element name="alt3" type="xx:Alt3"/>
    </xs:choice>
  </xs:complexType>

and suppose an instance type xx:Alt3 is to be serialized.

Then serialization fails with an exception, with the message:

  java.io.IOException: Non nillable element 'alt1' is null.

This appears to be coming from org.apache.axis.encoding.ser.BeanSerializer, and reflects changes
for nillable and omitable in revision 1.79.

If we change the definition to:

  <xs:complexType name="MIRStoreEntityRequestType">
    <xs:choice>
      <xs:element name="alt1" type="xx:Alt1" minOccurs="0"/>
      <xs:element name="alt2" type="xx:Alt2"/>
      <xs:element name="alt3" type="xx:Alt3"/>
    </xs:choice>
  </xs:complexType>

then the failure message becomes:

  java.io.IOException: Non nillable element 'alt2' is null.

It appears that BeanSerializer is taking account only of local attributes in elements alt1,
alt2, etc, and not taking account of their nesting in a <choice>.

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message