Hi, please find my below web service dummy code :
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public void TestFunction(object objData)
{
JavaScriptSerializer json_serializer = new JavaScriptSerializer();
var str = json_serializer.Serialize(objData);
MyClass MyModal = json_serializer.Deserialize<MyClass>(str);
}
Above code is working fine when I am accessing it as web service and calling it via postman.Bug when I tried to call this from another method with in same class it is not accepting my json as it is in string format. Below find below method
void TestFunction2(string MyModal)
{
TestFunction(MyModal);
}
I don't know how to pass string of type json like the way postman is sending when we select content-type as "application/json". I can't alter TestFunction as it is working fine and many clients are using this. I only want to know how to pass json if I have this in string variable.