【发布时间】:2011-05-14 01:15:21
【问题描述】:
当以编程方式更新 wcf 服务的 web.config 时,可以通过以下方式添加行为...
ServiceModelSectionGroup secgroup = (ServiceModelSectionGroup)_webConfig.GetSectionGroup("system.serviceModel");
ServiceBehaviorElement SerBeh3 = new ServiceBehaviorElement();
SerBeh3.Name = "AuthenticationSvcWrapBehavior";
secgroup.Behaviors.ServiceBehaviors.Add(SerBeh3);
我的问题是如何添加绑定部分?
我要做的就是创建一个包含名称、模式和 Transport.ClientCredentialType 的绑定,然后将 BindingConfiguration 设置为端点的所述名称。
【问题讨论】:
标签: c# wcf configuration