Mostly I get the object graph I desire with all the values correctly deserialzed, but I can not find a way to get the XMLSerialiser to deserialize the session collection within an action element - The are always empty.

Does anyone know how I might build my POCOs so that the XMLserialiser can create the session collections?

Thanks Alex: I have just done as you suggested, I looked at the code generated by the tool, in particular the attribute it placed on the Session Collection - [System.Xml.Serialization.XmlElementAttribute("session", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] I applied this attribute to my session collection in the action class, and now the xml is fully deserialized. Thank you very much. I never new about the xsd comman before much appreciated. John
–
JohnFeb 14 '12 at 17:42

ObservableCollection appears to work: as the status collection of the message is deserialized correctly.
–
JohnFeb 14 '12 at 17:09

Hi thanks for the quick response... ObservableCollection appears to work: as the status collection of the message is deserialized correctly. If I make session inherit action... when I run the app I get an InvalidOperationException And adding [XmlInclude(typeof(session))] does not improve the situation, I still get empty session collections
–
JohnFeb 14 '12 at 17:15

Sadly the vs compiler does not like [XmlArray(typof(session))] it insists that it must be a string and gives the following error: System.Xml.Serialization.XmlArrayAttribute.XmlArrayAttribute(string)' has some invalid arguments
–
JohnFeb 14 '12 at 17:25

I do agree that the issue is that I can not define the 'action' array within the action class. If I had control of the xml i would nest the sessions within a session_collection element. Unfortunately I have to take the xml as is.
–
JohnFeb 14 '12 at 17:27

@John - Ah ok, does using the string ("session") work instead of using typeof (guessing not)?
–
SwDevMan81Feb 14 '12 at 19:58