Thursday, October 16, 2008

Troubleshooting WCF WebService

Recently while developing a WCF Service for AX Employee Data, came across this particular
Error:
Type 'System.Xml.XmlDocument' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.

Resolution:
Put xmlserializerformat just above your datamethod in your interface class.
[OperationContract]
[XmlSerializerFormat]
XmlDocument GetEmployees();

No comments:

Post a Comment