Beispiel #1
0
        /// <summary>
        /// Creates an instance of an <see cref="HttpMessageChannel"/> using the HTTP message handlers
        /// provided in the constructor.
        /// </summary>
        /// <param name="innerChannel">The inner channel represents the destination of the HTTP message channel.</param>
        /// <returns>The HTTP message channel.</returns>
        public HttpMessageChannel Create(HttpMessageChannel innerChannel)
        {
            if (innerChannel == null)
            {
                throw Fx.Exception.ArgumentNull("innerChannel");
            }

            return this.OnCreate(innerChannel);
        }
            protected override HttpMessageChannel OnCreate(HttpMessageChannel innerChannel)
            {
                HttpMessageChannel channel = new HttpQueryMessageHandler(innerChannel, this.queryLimit);

                if (this.innerFactory != null)
                {
                    channel = this.innerFactory.Create(channel);
                }

                return(channel);
            }
        public BasicAuthenticationHandler(HttpMessageChannel innerChannel, IUserValidation userValidation, string realm)
            : base(innerChannel)
        {
            if (userValidation == null)
                throw new ArgumentNullException("userValidation");

            if (string.IsNullOrEmpty(realm))
                throw new ArgumentNullException("realm");

            this.userValidation = userValidation;
            this.realm = realm;
        }
        protected override HttpMessageChannel OnCreate(HttpMessageChannel innerChannel)
        {
            if (innerChannel == null)
            {
                throw new ArgumentNullException("innerChannel");
            }

            HttpMessageChannel pipeline = innerChannel;

            foreach (var factory in this.factories)
            {
                pipeline = factory(innerChannel);
            }

            return pipeline;
        }
Beispiel #5
0
        /// <summary>
        /// Creates an instance of an <see cref="HttpMessageChannel"/> using the HTTP message handlers
        /// provided in the constructor.
        /// </summary>
        /// <param name="innerChannel">The inner channel represents the destination of the HTTP message channel.</param>
        /// <returns>The HTTP message channel.</returns>
        protected virtual HttpMessageChannel OnCreate(HttpMessageChannel innerChannel)
        {
            if (innerChannel == null)
            {
                throw Fx.Exception.ArgumentNull("innerChannel");
            }

            HttpMessageChannel pipeline = innerChannel;
            try
            {
                foreach (var ctor in this.handlerCtors)
                {
                    pipeline = (DelegatingChannel)ctor.Invoke(new object[] { pipeline });
                }
            }
            catch (TargetInvocationException tie)
            {
                Fx.Exception.AsError(tie.InnerException);
                throw;
            }

            return pipeline;
        }
 public InvalidConstructorHandler(HttpMessageChannel innerChannel, bool test) : base(innerChannel)
 {
 }
Beispiel #7
0
 public LoggingChannel(HttpMessageChannel handler)
     : base(handler)
 {
 }
Beispiel #8
0
 public PostStatusCodeMessageHandler(HttpMessageChannel innerChannel)
     : base(innerChannel)
 {
 }
Beispiel #9
0
 public TracingChannel(HttpMessageChannel handler)
     : base(handler)
 {
 }
 public StatusKillerMessageHandler(HttpMessageChannel innerChannel)
     : base(innerChannel)
 {
 }
Beispiel #11
0
 public TestHandler(HttpMessageChannel innerChannel) : base(innerChannel)
 {
 }
Beispiel #12
0
 public TestHandler(HttpMessageChannel innerChannel)
     : base(innerChannel)
 {
     throw new Exception("Handler constructor failure");
 }
 protected override HttpMessageChannel OnCreate(HttpMessageChannel innerChannel)
 {
     return(this.create(innerChannel));
 }
 public MockValidMessageHandler(HttpMessageChannel innerChannel) : base(innerChannel)
 {
 }
Beispiel #15
0
 public MockInvalidMessageHandler(HttpMessageChannel innerChannel, bool test) : base(innerChannel)
 {
 }
 public ValidConstructorHandler(HttpMessageChannel innerChannel) : base(innerChannel)
 {
 }
Beispiel #17
0
 public HttpHostConfiguration SetChannel(HttpMessageChannel channel)
 {
     this.Channel = channel;
     return(this);
 }
 public HttpQueryMessageHandler(HttpMessageChannel inner, int queryLimit)
     : base(inner)
 {
     this.queryLimit = queryLimit;
 }
Beispiel #19
0
 protected override HttpMessageChannel OnCreate(HttpMessageChannel innerChannel)
 {
     return(null);
 }
 public BasicAuthenticationHandler(HttpMessageChannel innerChannel)
     : base(innerChannel)
 {
 }
Beispiel #21
0
 public TestHandler(HttpMessageChannel innerChannel)
     : base(innerChannel)
 {
     DisposeHandlerTests.handlerList.Add(this);
 }
 public UriFormatExtensionMessageChannel(HttpMessageChannel handler)
     : base(handler)
 {
 }