internal void InvokeEndMethod(ServiceMethodInfo methodInfo, object service, IAsyncResult result, HttpResponse httpResponse) { ExTraceGlobals.CoreTracer.TraceDebug(0L, "OwaServiceMethodDispatcher.InvokeEndMethod"); object response = null; using (CpuTracker.StartCpuTracking("END")) { OwaDiagnostics.SendWatsonReportsForGrayExceptions(delegate() { response = methodInfo.EndMethod.Invoke(service, new object[] { result }); }, new Func <Exception, bool>(this.CanIgnoreExceptionForWatsonReport)); } if (methodInfo.ShouldAutoDisposeResponse && response != null) { this.delayedDisposalResponseObject = response; } this.inspector.BeforeSendReply(httpResponse, methodInfo.Name, response); using (CpuTracker.StartCpuTracking("WRITE")) { OwaServiceMethodDispatcher.WriteResponse(methodInfo, httpResponse, response); } }
private void InternalInvokeMethod(ServiceMethodInfo methodInfo, object service, HttpRequest httpRequest, HttpResponse httpResponse, object[] arguments) { object request = (arguments != null) ? arguments[0] : null; this.inspector.AfterReceiveRequest(httpRequest, methodInfo.Name, request); if (methodInfo.ShouldAutoDisposeRequest && arguments != null) { this.delayedDisposalRequestObjects = arguments; } object response = null; using (CpuTracker.StartCpuTracking("EXEC")) { OwaDiagnostics.SendWatsonReportsForGrayExceptions(delegate() { response = this.InvokeSyncMethod(httpRequest, methodInfo, service, arguments); }, new Func <Exception, bool>(this.CanIgnoreExceptionForWatsonReport)); } if (methodInfo.ShouldAutoDisposeResponse && response != null) { this.delayedDisposalResponseObject = response; } using (CpuTracker.StartCpuTracking("WRITE")) { OwaServiceMethodDispatcher.WriteResponse(methodInfo, httpResponse, response); } }