How to change binding properties(custom binding)
Uri baseAddress = new Uri("https://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();
Comments
- Anonymous
June 15, 2009
PingBack from http://unemploymentofficeresource.info/story.php?id=14870