I created a .NET 4.0 WCF web service and put it up on our internal server.
Now, I am testing this with a simple project that queries the web service.
However, I have found that all of my property names have been appended with the k_BackingField string.
[System.Runtime.Serialization.DataMemberAttribute(Name="<WoNumber>k__BackingField", IsRequired=true)]
public string WoNumberk__BackingField {
get {
return this.WoNumberk__BackingFieldField;
}
set {
if ((object.ReferenceEquals(this.WoNumberk__BackingFieldField, value) != true)) {
this.WoNumberk__BackingFieldField = value;
this.RaisePropertyChanged("WoNumberk__BackingField");
}
}
}
I did a search on this k_BackingField parameter, and found this link to be my best reference:
how to command serializer not to put k__backingfield
Apparently, I have somehow used the XmlSerializer instead of the DataContractSerializer.
What I can't seem to find is how to "undo" the XmlSerialization and enable the DataContractSerializer.
In my project, I have tried searching the entire project for the following XML keywords, but they do not seem to be pulling up:
- XmlSerializerFormat
- System.Xml.Serialization
- XmlSerialzer
Does anyone know how to remove XmlSerialization and then re-add my Service Reference using a DataContractSerializer?
Or, does my WCF Service need to be modified so that it exposes the Serializer I want?