示例#1
0
        public override Stream Process(Stream requestStream)
        {
            ServiceScopeWrapper serviceScope = this.RootContainer.CreateServiceScope();

            this.RequestContainer = serviceScope.ServiceProvider;

            try
            {
                RequestHandler handler = this.DispatchHandler();

                if (this.PreferenceContext.RespondAsync)
                {
                    return(handler.ProcessAsynchronously(requestStream));
                }

                return(handler.Process(requestStream));
            }
            catch (Exception e)
            {
                ErrorHandler handler = new PluggableFormatErrorHandler(this, e);
                return(handler.Process(null));
            }
            finally
            {
                serviceScope.Dispose();
            }
        }
示例#2
0
        public override Stream Process(Stream requestStream)
        {
            try
            {
                RequestHandler handler = this.DispatchHandler();

                if (this.PreferenceContext.RespondAsync)
                {
                    return(handler.ProcessAsynchronously(requestStream));
                }

                return(handler.Process(requestStream));
            }
            catch (Exception e)
            {
                ErrorHandler handler = new PluggableFormatErrorHandler(this, e);
                return(handler.Process(null));
            }
        }
        public override Stream Process(Stream requestStream)
        {
            try
            {
                RequestHandler handler = this.DispatchHandler();

                if (this.PreferenceContext.RespondAsync)
                {
                    return handler.ProcessAsynchronously(requestStream);
                }

                return handler.Process(requestStream);
            }
            catch (Exception e)
            {
                ErrorHandler handler = new PluggableFormatErrorHandler(this, e);
                return handler.Process(null);
            }
        }