Example #1
0
        public override IChannelListener <TChannel> BuildChannelListener <TChannel>(BindingContext context) where TChannel : class, IChannel
        {
            if (typeof(TChannel) != typeof(IReplyChannel))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("TChannel", System.ServiceModel.SR.GetString("ChannelTypeNotSupported", new object[] { typeof(TChannel) }));
            }
            HttpChannelListener listener = new HttpsChannelListener(this, context);

            AspNetEnvironment.Current.ApplyHostedContext(listener, context);
            return((IChannelListener <TChannel>)listener);
        }
        public override IChannelListener <TChannel> BuildChannelListener <TChannel>(BindingContext context)
        {
            if (context == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
            }

            HttpChannelListener listener;

            if (!this.CanBuildChannelListener <TChannel>(context))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("TChannel", SR.GetString(SR.ChannelTypeNotSupported, typeof(TChannel)));
            }

            this.UpdateAuthenticationSchemes(context);

            listener = new HttpsChannelListener <TChannel>(this, context);
            AspNetEnvironment.Current.ApplyHostedContext(listener, context);
            return((IChannelListener <TChannel>)(object) listener);
        }