I have the following method in my WCF service:
[OperationContract]
[WebInvoke(Method = \"POST\", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessag
Valid XML must have a single root element. Also there's no magic in WCF REST that maps XML elements to string parameters. You could take an XElement as your operation parameter.
[OperationContract]
[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Xml, RequestFormat = WebMessageFormat.Xml)]
public int GetOne(XElement content)
{
string param1 = content.Elements().First(element => element.Name == "param1").Value;
string param2 = content.Elements().First(element => element.Name == "param2").Value;
return 1;
}
The data you send would be something like:
something
something