I create a method to receive json string, the method definition is below:
[OperationContract]
string AccessAtomService(string cmd);
It works when I invoke this method by following input:
{
"receivers": [
"[email protected]"
],
"subject": "Notification",
"isHtml": false,
"content": "Test ok",
"serviceName": "xxx"
}
But the following json input causes exception:
{
"receivers": ["[email protected]"],
"subject": "EMS3000 Notification",
"isHtml": false,
"content":"<a href=\"http://www.w3schools.com/html/\">Visit our HTML tutorial</a>",
"serviceName": "xxx"
}
It seems that any xml element in my json string would cause exception, the exception message from WCF tarce log is:
System.ServiceModel.Dispatcher.NetDispatcherFaultException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
First StackTrace item is:
System.ServiceModel.Dispatcher.PrimitiveOperationFormatter.DeserializeRequest(Message message, Object[] parameters)
Thanks for any help