The company I am working for has asked me to create a web service in ASMX that accepts input as JSON and outputs the response as JSON.
How can I specify that a web method accepts JSON input?
I could achieve this by creating a web method with a string parameter and then deserializing the string myself (assuming that the string contains a JSON string)...
But what I want to know is this: is there a way to make the framework (ASMX) do this for me automatically?
[WebMethod]
[System.Web.Script.Services.ScriptMethod(ResponseFormat
System.Web.Script.Services.ResponseFormat.Json)]
public string method(Model model) {
// automatically deserialise the model
}