I am working on WCF application, I am invoking this operation
[ServiceContract]
public interface IAuditDataService
{
[OperationContract(Name = "UserAuthentication")]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest, UriTemplate = "/UserAuthentication?username={username}")]
string UserAuthentication(string username, UserData userInfo);
}
I am getting error
"Object Reference not set to an instance"
here
public string UserAuthentication(string username, UserData userInfo)
{
string outputData = string.Empty;
return userInfo.ToString(); // << Error at this line
}
Here is the JSON Class
[DataContract]
[Serializable()]
public class UserData
{
[DataMember(Name = "UserName", Order = 1)]
public string UserName { get; set; }
[DataMember(Name = "Password", Order = 2)]
public string Password { get; set; }
[DataMember(Name = "Token", Order = 3)]
public string Token { get; set; }
}
Here is JSON request via POST method
{"UserName":"abcd",
"Password":"1234",
"Token":"1234"}
Here is response screen shot 
Any Help !