I have an object, Teacher, that has a namespace. Let's call it
http://foo.
Teacher has a child object called Name, composed of String first, middle,
last, etc. Problem I have is when I try to deserialize it. When I
deserialize a single Teacher, it works when I put the namespace on the
Teacher element. However, if I have just the namespace on Teacher, it will
deserialize fine as Teacher. *However*, if I try to deserialize an
ArrayOfTeacher, Teacher.Name doesn't deserialize (it's null); without the
array, it's OK. What I wound up doing was serializing both a Teacher and an
ArrayOfTeacher and found that when it's just TEacher, the serializer puts
the xsd and xsi namespaces on the array & put the
http://foo namespace *on
the Name element only*. If I put that same namespace on both Teacher *and*
Name, it comes out OK, except when deserializing an ArrayOfTeacher.
So basically, my problem is: where do I put the namespaces for consistent
deserialization? If the object to be deserialized is in an array, only its
children can have the namespace declared on it, but not vice versa, so I
have no consistent way to represent the Teacher as XML and have it
deserialize both as a single entity and an array of them.