Newbie in WCF, I am to define a restful interface for taking in requests in xml. The xml can belongs to any type of schema, instead of defining a data contract describing every data member, I want to my data contract to a simple string, which basicaly says you can send me anything, ideally, it looks below,
[OperationContract]
void SubmitESBMessage(string data);
Tried to define the contract to be
[DataContract]
public class OnRampData
{
[DataMember]
public string Data { get; set; }
}
But I don’t want to tell my users to escape their xml and put into the OnRampData.
Anyone please help. Thanks in advance.
If you want to take any XML as your input, then you can use
XmlElementorXElementas the parameter type. WCF treats those types as “all the XML from the request body”.