Hello, I had an odd problem today when I was trying to serialize an object. The object was generated via "Add service reference" from a web service (svcutil.exe).
The problem was that the below property (agencyId) was not being serialized with the rest of the object. Out of desperation I commented the property below it because it had the "XMLIgnoreAttribute" assigned... after I commented the ignored property, the agencyId field serialized as expected.
Can someone please explain to me why this behavior occurred? Thanks!!
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)]
public string agencyId
{
get {
return this.agencyIdField;
}
set {
this.agencyIdField = value;
this.RaisePropertyChanged("agencyId");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool agencyIdSpecified
{
get
{
return this.agencyIdFieldSpecified;
}
set
{
this.agencyIdFieldSpecified = value;
this.RaisePropertyChanged("agencyIdSpecified");
}
}