[ http://issues.apache.org/jira/browse/AXIS-1813?page=comments#action_60954 ] Nick Sharman commented on AXIS-1813: ------------------------------------
The problem was most likely caused by using stubs generated by one version of Axis but executed in the context of a later version. Whether this is the case or not, the problem is not present when using Axis 1.2 RC3 consistently (for both stub generation & at run time). Not sure of the protocol round here, but I believe this issue can now be closed. > 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
