Title: Parent/Child relationship in AXIS

Hi,

I have a general question regarding generated XML in case when xsd extension is used.

I have my types defined as follows:

        <element name="Step" type="tns:ScriptFormType" abstract="true"/>

        <complexType name="ScriptFormType">
             <sequence>
                <element name="FUNCTION" type="integer"/>
                <element name="SelectedRow" type="nonNegativeInteger"/>
             </sequence>
        </complexType>

        <element name="STEP_KS1" type="tns:ComplistStepKS1" substitutionGroup="tns:Step"/>

        <complexType name="ComplistStepKS1">
             <complexContent>
                        <extension base="tns:ScriptFormType">
                             <sequence>
                        <element name="FORM" type="string" />
                        <element name="FIELDS" type="my_other_type"/>
                             </sequence>
                        </extension>
             </complexContent>
        </complexType>   

I am talking not about generated child class, but about actual message on the wire.
I have the message, captured by tcpmon:

    <ns7:Step xsi:type="ns6:ComplistStepKS1"
        xmlns:ns6="http://localhost/ctron/exec/schemas/csuvscni/complist"
        xmlns:ns7="http://localhost/ctron/exec/schemas/AppGlobals">
        <FORM>KS1</FORM>
        <FIELDS>
             <COMPNUM>999</COMPNUM>
             <SRCCODE>AAA</SRCCODE>
        </FIELDS>
        <ns7:SelectedRow>0</ns7:SelectedRow>
        <FUNCTION>32</FUNCTION>
    </ns7:Step>

ComplistStepDS1 is the subclass of ScriptFormType, and as I understand parent class should be initialized first and its fields should appear before child fields in XML message. So I really expect it to be like this, because

    <ns7:Step xsi:type="ns6:ComplistStepKS1"
        xmlns:ns6="http://localhost/ctron/exec/schemas/csuvscni/complist"
        xmlns:ns7="http://localhost/ctron/exec/schemas/AppGlobals">
        <FUNCTION>32</FUNCTION>
        <ns7:SelectedRow>0</ns7:SelectedRow>
        <FORM>KS1</FORM>
        <FIELDS>
             <COMPNUM>999</COMPNUM>
             <SRCCODE>AAA</SRCCODE>
        </FIELDS>
     </ns7:Step>

Am I right or wrong? Should Parent/Child relationship be reflected in XML message itself?
I don't think this message could be validated ( I am not validating it right now).
Is this expected behavior and does this happen only in AXIS?


Thanks,
Michael

Reply via email to