Hi
Here's the scenario...
I have a web method to which a pass a customer ID. The web method looks up
the customer and returns an XmlNode which I deserialise into a type. I then
update information in the type and then serialise it back into an
XmlDocument ready for submission to another web method. The problem is that
during serialisation, some, but not all attributes are not being created in
the document.
I've checked the originating document, the attributes appear as they should.
I've checked the type instance following deserialisation and the values are
populated correctly.
I've included the default namespace and XmlSerializerNamespaces, but that
doesn't seem to make a difference.
I even wired up the events on the XmlSerializer, but nothing was fired.
Here's one of the offending types...
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://www.namespace.com")]
public class AddressType {
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
[System.ComponentModel.DefaultValueAttribute(4)]
public int CodeID = 4;
/// <remarks/>
[System.Xml.Serialization.XmlTextAttribute()]
public string Value;
}
The really strange thing is another type which is exactly the same bar the
name and DefaultValueAttribute serialises just fine.
Any ideas?
Thanks
Glenn
VS2005 C# XP