/// <summary> /// /// </summary> /// <param name="context"></param> public void ProcessRequest(HttpContext context) { HttpRequest request = context.Request; HttpResponse response = context.Response; JSONRpcCall call = JSON.ParseRPC(new System.IO.StreamReader(request.InputStream)); object result = null; ISpellChecker spellchecker = new GoogleSpellChecker(); switch (call.Method) { case "checkWords": result = spellchecker.CheckWords((string) call.Args[0], (string[]) ((ArrayList) call.Args[1]).ToArray(typeof(string))); break; case "getSuggestions": result = spellchecker.GetSuggestions((string) call.Args[0], (string) call.Args[1]); break; } // Serialize RPC output JSON.SerializeRPC( call.Id, null, result, response.OutputStream ); }
/// <summary> /// /// </summary> /// <param name="context"></param> public void ProcessRequest(HttpContext context) { HttpRequest request = context.Request; HttpResponse response = context.Response; JSONRpcCall call = JSON.ParseRPC(new System.IO.StreamReader(request.InputStream)); object result = null; ISpellChecker spellchecker = new GoogleSpellChecker(); switch (call.Method) { case "checkWords": result = spellchecker.CheckWords((string)call.Args[0], (string[])((ArrayList)call.Args[1]).ToArray(typeof(string))); break; case "getSuggestions": result = spellchecker.GetSuggestions((string)call.Args[0], (string)call.Args[1]); break; } // Serialize RPC output JSON.SerializeRPC( call.Id, null, result, response.OutputStream ); }