Welcome to MSDN Blogs Sign in | Join | Help

Changing BindingElement settings on a Binding.


We don’t allow you to modify the properties of the binding directly, but you can create a copy of the binding elements used to create a particular binding, alter the desired properties, then use the binding element collection to create a new custom binding. 
BasicHttpBinding basicBinding = new BasicHttpBinding();
BindingElementCollection bindingElementCollection = basicBinding.CreateBindingElements();
bindingElementCollection.Find<HttpTransportBindingElement>().KeepAliveEnabled = false;
CustomBinding myBasicBinding = new CustomBinding(bindingElementCollection);

		
Published Monday, May 15, 2006 11:03 AM by phenning
Filed under:

Comments

No Comments
Anonymous comments are disabled
 
Page view tracker