internal static void CallResponseCallback(byte[] responseBody, SoapLoggerSettings settings) { if (_requestBody != null) { //something went wrong, either pipeline execution didn't reach web-service method //or web-service method didn't call 'ReadRequestSetResponseCallback' //TODO determine case and log both files for first case var requestBody = _requestBody; _requestBody = null; SoapLoggerTools.WriteFileDefault(requestBody, true, settings.LogPath, false); SoapLoggerTools.WriteFileDefault(responseBody, false, settings.LogPath, false); //TODO add logging error message to file throw new LoggerException("something went wrong, either pipeline execution didn't reach web-service method or web-service method didn't execute 'SoapLoggerService.CallCustomHandlers'"); } try { _service.HandleResponseBodyCallback(responseBody, settings); } finally { _service = null; } }
public static void CallCustomHandlers(ISoapLoggerHandlerService service) { if (service == null) { throw new ArgumentNullException("service"); } if (_settings == null) { throw new InvalidOperationException("_settings is null"); } if (_requestBody == null) { service.CustomHandlersDisabled(_settings); return; } _service = service; try { _service.HandleRequestBody(_requestBody, _settings); } finally { _requestBody = null; _settings = null; } }