Exemple #1
0
 internal void RunExtensions(SoapExtension[] extensions, bool throwOnException)
 {
     if (extensions != null)
     {
         TraceMethod caller = Tracing.On ? new TraceMethod(this, "RunExtensions", new object[] { extensions, throwOnException }) : null;
         if ((this.stage & (SoapMessageStage.AfterDeserialize | SoapMessageStage.BeforeDeserialize)) != ((SoapMessageStage)0))
         {
             for (int i = 0; i < extensions.Length; i++)
             {
                 if (Tracing.On)
                 {
                     Tracing.Enter("SoapExtension", caller, new TraceMethod(extensions[i], "ProcessMessage", new object[] { this.stage }));
                 }
                 extensions[i].ProcessMessage(this);
                 if (Tracing.On)
                 {
                     Tracing.Exit("SoapExtension", caller);
                 }
                 if (this.Exception != null)
                 {
                     if (throwOnException)
                     {
                         throw this.Exception;
                     }
                     if (Tracing.On)
                     {
                         Tracing.ExceptionIgnore(TraceEventType.Warning, caller, this.Exception);
                     }
                 }
             }
         }
         else
         {
             for (int j = extensions.Length - 1; j >= 0; j--)
             {
                 if (Tracing.On)
                 {
                     Tracing.Enter("SoapExtension", caller, new TraceMethod(extensions[j], "ProcessMessage", new object[] { this.stage }));
                 }
                 extensions[j].ProcessMessage(this);
                 if (Tracing.On)
                 {
                     Tracing.Exit("SoapExtension", caller);
                 }
                 if (this.Exception != null)
                 {
                     if (throwOnException)
                     {
                         throw this.Exception;
                     }
                     if (Tracing.On)
                     {
                         Tracing.ExceptionIgnore(TraceEventType.Warning, caller, this.Exception);
                     }
                 }
             }
         }
     }
 }
Exemple #2
0
        internal void RunExtensions(SoapExtension[] extensions, bool throwOnException)
        {
            if (extensions == null)
            {
                return;
            }

            TraceMethod caller = Tracing.On ? new TraceMethod(this, "RunExtensions", extensions, throwOnException) : null;

            // Higher priority extensions (earlier in the list) run earlier for deserialization stages,
            // and later for serialization stages
            if ((stage & (SoapMessageStage.BeforeDeserialize | SoapMessageStage.AfterDeserialize)) != 0)
            {
                for (int i = 0; i < extensions.Length; i++)
                {
                    if (Tracing.On)
                    {
                        Tracing.Enter("SoapExtension", caller, new TraceMethod(extensions[i], "ProcessMessage", stage));
                    }
                    extensions[i].ProcessMessage(this);
                    if (Tracing.On)
                    {
                        Tracing.Exit("SoapExtension", caller);
                    }
                    if (Exception != null)
                    {
                        if (throwOnException)
                        {
                            throw Exception;
                        }
                        if (Tracing.On)
                        {
                            Tracing.ExceptionIgnore(TraceEventType.Warning, caller, Exception);
                        }
                    }
                }
            }
            else
            {
                for (int i = extensions.Length - 1; i >= 0; i--)
                {
                    if (Tracing.On)
                    {
                        Tracing.Enter("SoapExtension", caller, new TraceMethod(extensions[i], "ProcessMessage", stage));
                    }
                    extensions[i].ProcessMessage(this);
                    if (Tracing.On)
                    {
                        Tracing.Exit("SoapExtension", caller);
                    }
                    if (Exception != null)
                    {
                        if (throwOnException)
                        {
                            throw Exception;
                        }
                        if (Tracing.On)
                        {
                            Tracing.ExceptionIgnore(TraceEventType.Warning, caller, Exception);
                        }
                    }
                }
            }
        }
Exemple #3
0
        internal void RunExtensions(SoapExtension[] extensions, bool throwOnException)
        {
            if (extensions == null)
            {
                return;
            }
            TraceMethod traceMethod1;

            if (!Tracing.On)
            {
                traceMethod1 = (TraceMethod)null;
            }
            else
            {
                traceMethod1 = new TraceMethod((object)this, "RunExtensions", new object[2]
                {
                    (object)extensions,
                    (object)(bool)(throwOnException ? 1 : 0)
                });
            }
            TraceMethod traceMethod2 = traceMethod1;

            if ((this.stage & (SoapMessageStage)12) != (SoapMessageStage)0)
            {
                for (int index = 0; index < extensions.Length; ++index)
                {
                    if (Tracing.On)
                    {
                        Tracing.Enter("SoapExtension", traceMethod2, new TraceMethod((object)extensions[index], "ProcessMessage", new object[1]
                        {
                            (object)this.stage
                        }));
                    }
                    extensions[index].ProcessMessage(this);
                    if (Tracing.On)
                    {
                        Tracing.Exit("SoapExtension", traceMethod2);
                    }
                    if (this.Exception != null)
                    {
                        if (throwOnException)
                        {
                            throw this.Exception;
                        }
                        if (Tracing.On)
                        {
                            Tracing.ExceptionIgnore(TraceEventType.Warning, traceMethod2, (Exception)this.Exception);
                        }
                    }
                }
            }
            else
            {
                for (int index = extensions.Length - 1; index >= 0; --index)
                {
                    if (Tracing.On)
                    {
                        Tracing.Enter("SoapExtension", traceMethod2, new TraceMethod((object)extensions[index], "ProcessMessage", new object[1]
                        {
                            (object)this.stage
                        }));
                    }
                    extensions[index].ProcessMessage(this);
                    if (Tracing.On)
                    {
                        Tracing.Exit("SoapExtension", traceMethod2);
                    }
                    if (this.Exception != null)
                    {
                        if (throwOnException)
                        {
                            throw this.Exception;
                        }
                        if (Tracing.On)
                        {
                            Tracing.ExceptionIgnore(TraceEventType.Warning, traceMethod2, (Exception)this.Exception);
                        }
                    }
                }
            }
        }