Using Visual Studio 2010 , FrameWork 3.5, Application WebService.
below is the code in web service :
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public void StartActivity(JObject objData)
{
}
I am getting error just by declaring jobject as parameter (at run time) as function is void we can avoid implementation.
Although no error if method is not a web method.
No error in compile time, but when I run this code I got below error :
You must implement a default accessor on Newtonsoft.Json.Linq.JObject because it inherits from ICollection.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: You must implement a default accessor on Newtonsoft.Json.Linq.JObject because it inherits from ICollection.