Force serialization of property with DefaultValueAttribute in WCF request
After creating a service reference in VS2013 - using XmlSerializer, one property in the auto-generated classes is decorated with DefaultValueAttribute("UTF-8").
If I set the property to something different than "UTF-8", the property gets serialized in the request as expected. But if I set it to the default value "UTF-8", the property is not serialized.
I get that this is the functionality to expect from XmlSerializer, but the problem is that that the company hosting the service insists that we include the property in the request.
So my question is: Is there any way to force the serialization of a property with default value, or alternative, not to include the DefaultValueAttribute during generation of service reference classes?
链接地址: http://www.djcxy.com/p/65146.html上一篇: 序列化没有父标记的对象列表