MADHU@MICROSOFT BLOG

All About Distributed apps

How to change binding properties(custom binding)

How to change binding properties(custom binding)

  • Comments 1

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: SvcUtil.exe.config
Leave a Comment
  • Please add 4 and 8 and type the answer here:
  • Post