예제 #1
0
        public virtual void HandleBody(byte[] body, bool request)
        {
            SoapLoggerTools.WriteFileDefault(body, request, _settings.LogPath, _settings.SaveOriginalBinaryBody);

            if (!_settings.UseCustomHandler && _settings.IsClient && request)
            {
                SoapLoggerClient.CallCustomHandlersDisabledCallback(_settings);
            }
        }
예제 #2
0
        //Debug.QuickWatch: Encoding.UTF8.GetString(body)

        internal void HandleBody(byte[] body, bool request)
        {
            if (settings.IsService && request)
            {
                SoapLoggerService.SetSettings(settings);
            }

            if (settings.IsService && !request)
            {
                var requestException = SoapLoggerService.GetRequestException();

                if (requestException != null)
                {
                    throw requestException;
                }
            }

            if (settings.UseCustomHandler)
            {
                if (request)
                {
                    HandleRequest(body);
                }
                else
                {
                    HandleResponse(body);
                }
            }
            else
            {
                if (settings.IsClient && request)
                {
                    SoapLoggerClient.CallCustomHandlersDisabledCallback(settings);
                }

                //default handler
                SoapLoggerTools.WriteFileDefault(body, request, settings.LogPath);
            }
        }
예제 #3
0
 protected override void HandleResponse(byte[] body)
 {
     SoapLoggerClient.CallResponseCallback(body, settings);
 }
예제 #4
0
 public WeatherServiceClientCustomHandler()
 {
     // you need just this line in constructor of inherited client class to apply your custom handler to all requests
     // NOTE: don't reuse this custom handling client class object twice, it should be instantiated for every new request
     SoapLoggerClient.SetCustomHandlerCallbacks(this);
 }
 protected override void GetForecast(string location, int days)
 {
     SoapLoggerClient.SetCustomHandlerCallbacks(this);
     base.GetForecast(location, days);
 }
 protected override void GetLastReport(string location)
 {
     SoapLoggerClient.SetCustomHandlerCallbacks(this);
     base.GetLastReport(location);
 }