tags:

views:

70

answers:

1

I want to create a WCF service that accepts an XML message that interoperates with a non MS consumer. Now, I could expose a method that accepts a string and then handle the XML from that point onwards. Is there a better approach than using a string parameter?

Thanks

A: 

You could use an XmlNode parameter.

Kragen
Would I not then have to use Data Contracts? I just want to be able to receive any kind of XML and then perform XML and schema validation after receiving the XML.
Jon Archway
I dont think so - just use an XmlNode in place of a string.
Kragen
You end up with the following errorType 'System.Xml.XmlNode' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. See the Microsoft .NET Framework documentation for other supported types.
Jon Archway
Ah, I think XmlElement might do it...
Jon Archway