Forcing ASMX proxy to use XmlSerializer instead of DataContractSerializer

∥☆過路亽.° 提交于 2019-12-05 21:01:13

If you are using WCF the default is DataContractSerializer. And if the types do not have explicit [DataContract]/[DataMember] markers, then DataContractSerializer will use the fields, which sounds like what is happening.

To use XmlSerializer instead, add [XmlSerializerFormat] to your service. See MSDN.

You could also try adding [XmlType] or [XmlRoot] to your classes (if it isn't already there).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!