[ScriptMethod(ResponseFormat=ResponseFormat.Json)]
[WebMethod]
public MyClass GetID(string id)
{
var myobj = new MyClass();
//instead of serializing your object manually and returning a string
//directly return your object. Webservice will do it for you.
return myobj;
}