How to change binding properties(custom binding)
Uri baseAddress = new Uri("http://localhost:8081/testsvc");
ServiceHost sh = new ServiceHost(typeof(CalculatorService), baseAddress);
WSDualHttpBinding b = new WSDualHttpBinding();
BindingElementCollection bec = b.CreateBindingElements();
TextMessageEncodingBindingElement sbe = bec.Find<TextMessageEncodingBindingElement>();
sbe.MessageVersion = MessageVersion.Soap11WSAddressingAugust2004;
CustomBinding cb = new CustomBinding(bec);
sh.AddServiceEndpoint("WCFSAMPLES.ICalculatorDuplex", cb, "");
sh.Open();
Console.WriteLine("service is ready");
Console.ReadKey();
Attachment(s): SvcUtil.exe.config
Comment Notification
If you would like to receive an email when updates are made to this post, please register here
Subscribe to this post's comments using