I am using Jayrock to form a web service in .NET for my iOS app and I'm following this tutorial. This is all good and I can get it to work fine returning basic strings using code like this:
[Jayrock.JsonRpc.JsonRpcMethod("Echo")]
[Jayrock.JsonRpc.JsonRpcHelp("Simple echo method, takes string input and returns it")]
public string Echo(string input)
{
return input;
}
When it comes to writing my actual web service, how to I get it to return a custom JSON object with numbers and arrays etc? If you could give a code example too that would be awesome.
I've had a google around and a search here, but haven't really been able to find much that helps me. I know it's a basic question, but I'm totally stumped!
All sorted now. I just needed to define a class and return an object from the function, like this: