private void ProcessResponse(HttpResponse httpResponse, ResponseBody body) { try { SetResponseHead(httpResponse); var buffer = ResponseFormater.Serialize(body); httpResponse.BinaryWrite(buffer); } catch (Exception error) { TraceLog.WriteError("Response handle error:{0}", error); httpResponse.StatusCode = 500; httpResponse.StatusDescription = "Response error."; } }
/// <summary> /// /// </summary> /// <param name="context"></param> /// <param name="body"></param> /// <returns></returns> protected byte[] ProcessResponse(IHttpRequestContext context, ResponseBody body) { return(ResponseFormater.Serialize(body)); }