I've generated classes using the xsd.exe from the AUTOSAR consortium supplied XSD file.
I would like to deserialize the following piece of XML code:
<END-TO-END-PROTECTION-VARIABLE-PROTOTYPES>
<END-TO-END-PROTECTION-VARIABLE-PROTOTYPE T="2017-07-31T13:37:48Z">
<RECEIVER-IREFS>
<RECEIVER-IREF>
<VARIABLE-DATA-PROTOTYPE-IN-SYSTEM-INSTANCE-REF T="2017-07-31T13:37:48Z">
<CONTEXT-COMPOSITION-REF DEST="ROOT-SW-COMPOSITION-PROTOTYPE">/Some/Reference/Value</CONTEXT-COMPOSITION-REF>
<TARGET-DATA-PROTOTYPE-REF DEST="VARIABLE-DATA-PROTOTYPE">/Another/Reference/Value</TARGET-DATA-PROTOTYPE-REF>
</VARIABLE-DATA-PROTOTYPE-IN-SYSTEM-INSTANCE-REF>
</RECEIVER-IREF>
</RECEIVER-IREFS>
</END-TO-END-PROTECTION-VARIABLE-PROTOTYPE>
</END-TO-END-PROTECTION-VARIABLE-PROTOTYPES>
But unfortunately the <RECEIVER-IREF>
content was not serialized.
The generated classes for the access are the following:
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.33440")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(TypeName="END-TO-END-PROTECTION-VARIABLE-PROTOTYPE", Namespace="http://autosar.org/schema/r4.0")]
public partial class ENDTOENDPROTECTIONVARIABLEPROTOTYPE {
/// <remarks/>
[System.Xml.Serialization.XmlArrayAttribute("RECEIVER-IREFS", Order=0)]
[System.Xml.Serialization.XmlArrayItemAttribute("RECEIVER-IREF", IsNullable=false)]
public VARIABLEDATAPROTOTYPEINSYSTEMINSTANCEREF[] RECEIVERIREFS;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string S;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("SENDER-IREF", Order=1)]
public VARIABLEDATAPROTOTYPEINSYSTEMINSTANCEREF SENDERIREF;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("SHORT-LABEL", Order=2)]
public IDENTIFIER SHORTLABEL;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string T;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("VARIATION-POINT", Order=3)]
public VARIATIONPOINT VARIATIONPOINT;
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.33440")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(TypeName="VARIABLE-DATA-PROTOTYPE-IN-SYSTEM-INSTANCE-REF", Namespace="http://autosar.org/schema/r4.0")]
public partial class VARIABLEDATAPROTOTYPEINSYSTEMINSTANCEREF {
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("CONTEXT-COMPONENT-REF", Order=0)]
public VARIABLEDATAPROTOTYPEINSYSTEMINSTANCEREFCONTEXTCOMPONENTREF[] CONTEXTCOMPONENTREF;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("CONTEXT-COMPOSITION-REF", Order=1)]
public VARIABLEDATAPROTOTYPEINSYSTEMINSTANCEREFCONTEXTCOMPOSITIONREF CONTEXTCOMPOSITIONREF;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("CONTEXT-PORT-REF", Order=2)]
public VARIABLEDATAPROTOTYPEINSYSTEMINSTANCEREFCONTEXTPORTREF CONTEXTPORTREF;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string S;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string T;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("TARGET-DATA-PROTOTYPE-REF", Order=3)]
public VARIABLEDATAPROTOTYPEINSYSTEMINSTANCEREFTARGETDATAPROTOTYPEREF TARGETDATAPROTOTYPEREF;
}
The generated classes seem to be correct and the XML tag structure too. I have no further idea why this is not deserialized.
Does anybody have any idea about the rootcause of this?