Hi,
I'm using Axis 1.0 and I have a trouble with the serialization of  a
derivated sequence.

I'm working with a schema equivalent to the following one:
<sequence name="A">
    <element name="AA"/>
    <element name="AB"/>
</sequence>
<sequence name="B">
    <complexContent>
        <extension base="A">
            <sequence>
                <element name="BB"/>
            </sequence>
        </extension>
    </complexContent>
</sequence>

When the class B is serialized with Axis, the sequence's order of the
subclass is not respected and the XML result is invalid according to the
Xschema (I've got something like <B><BB/><AB/><AA/></B> instead of
<B><AA/><AB/><BB/></B>).

After analysis, the BeanSerializer associated to the class B uses the
java.bean.Introspector for retrieving the list of attributes of the
superclass A (see the method TypeDesc.getPropertyDescriptor()). So the order
of the fields does not necessary correspond to the order of the sequence. It
will be better to use the TypeDescriptor defined in the superclass A which
contains the order of the XML sequence.

Do I have made something wrong or miss something in the definition of my
type?
Do you have any ideas how I could solve this problem?

Thanks in advance,
Fabrice.

Reply via email to