public void BuildChannelFactoryIgnoresRemaining ()
		{
			BindingContext ctx = new BindingContext (
				new CustomBinding (
					new HttpTransportBindingElement (),
					new InvalidBindingElement ()),
				empty_params);
			ctx.BuildInnerChannelFactory<IRequestChannel> ();
		}
		public void CreateChannelWithoutOpen ()
		{
			BindingContext ctx = new BindingContext (
				new CustomBinding (
					new HttpTransportBindingElement ()),
				empty_params);
			// returns HttpChannelFactory
			IChannelFactory<IRequestChannel> f =
				ctx.BuildInnerChannelFactory<IRequestChannel> ();
			IChannel c = f.CreateChannel (new EndpointAddress (
				"http://www.mono-project.com"));
		}
		// with July CTP it still works ...
		public void BuildChannelFactoryHttpNoMessage ()
		{
			BindingContext ctx = new BindingContext (
				new CustomBinding (
					new HttpTransportBindingElement ()),
				empty_params);
			IChannelFactory<IRequestChannel> cf =
				ctx.BuildInnerChannelFactory<IRequestChannel> ();
			cf.Open ();
		}
Esempio n. 4
0
 public InterceptorChannelFactory(InterceptorBindingElement element, BindingContext context)
     : base(null)
 {
     this.element = element;
     inner        = context.BuildInnerChannelFactory <TChannel> ();
 }
		public void CreateChannelInvalidScheme ()
		{
			MsmqTransportBindingElement be =
				new MsmqTransportBindingElement ();
			// Without settings them, it borks when MSMQ setup
			// does not support AD integration.
			be.MsmqTransportSecurity.MsmqAuthenticationMode =
				MsmqAuthenticationMode.None;
			be.MsmqTransportSecurity.MsmqProtectionLevel =
				ProtectionLevel.None;

			BindingContext ctx = new BindingContext (
				new CustomBinding (be),
				empty_params);
			// returns MsmqChannelFactory
			IChannelFactory<IOutputChannel> f =
				ctx.BuildInnerChannelFactory<IOutputChannel> ();
			f.Open ();
			f.CreateChannel (new EndpointAddress ("stream:dummy"));
		}
 public SimpleSessionChannelFactory(BindingContext context)
 {
     PrintHelper.Print(this, "SimpleSessionChannelFactory");
     this._innerChannelFactory = context.BuildInnerChannelFactory <TChannel>();
 }
 public override IChannelFactory <TChannel> BuildChannelFactory <TChannel>(BindingContext context)
 {
     context.BindingParameters.Add(this);
     return(context.BuildInnerChannelFactory <TChannel>());
 }
Esempio n. 8
0
 public ReconnectChannelFactory(BindingContext context, IEnumerable <Uri> viaAddresses) : base(context.Binding)
 {
     this.viaAddresses = viaAddresses;
     this.innerFactory = context.BuildInnerChannelFactory <TChannel>();
 }
Esempio n. 9
0
 public SimpleChannelFactoryBase(BindingContext context)
 {
     this.InnerChannelFactory = context.BuildInnerChannelFactory <TChannel>();
 }
Esempio n. 10
0
        public override IChannelFactory <TChannel> BuildChannelFactory <TChannel>(BindingContext context)
        {
            if (typeof(TChannel) != typeof(IRequestChannel))
            {
                ExceptionUtility exceptionUtility        = Microsoft.ServiceBus.Diagnostics.DiagnosticUtility.ExceptionUtility;
                string           channelTypeNotSupported = Resources.ChannelTypeNotSupported;
                object[]         objArray = new object[] { typeof(TChannel) };
                throw exceptionUtility.ThrowHelperArgument("TChannel", Microsoft.ServiceBus.SR.GetString(channelTypeNotSupported, objArray));
            }
            NameSettings nameSetting = context.BindingParameters.Find <NameSettings>();

            if (nameSetting == null)
            {
                nameSetting = new NameSettings();
                context.BindingParameters.Add(nameSetting);
            }
            nameSetting.ServiceSettings.ListenerType                  = ListenerType.RelayedHttp;
            nameSetting.ServiceSettings.TransportProtection           = (this is HttpsRelayTransportBindingElement ? RelayTransportProtectionMode.EndToEnd : RelayTransportProtectionMode.None);
            nameSetting.ServiceSettings.RelayClientAuthenticationType = this.relayClientAuthenticationType;
            nameSetting.ServiceSettings.IsDynamic = this.IsDynamic;
            BindingContext bindingContext = this.CreateInnerChannelBindingContext(context);

            return((IChannelFactory <TChannel>)(new RelayHttpTransportChannelFactory(context, bindingContext.BuildInnerChannelFactory <IRequestChannel>())));
        }