我有,我会创建这样的客户通道WCF客户端&服务解决方案:从配置设置行为?
for(int i = 0; i < clientSection.Endpoints.Count; i++)
{
if(clientSection.Endpoints[i].Name == endpointConfigurationName)
{
var endpointAddress = new EndpointAddress(clientSection.Endpoints[i].Address.ToString());
var netHttpBinding = new NetHttpBinding(clientSection.Endpoints[i].BindingConfiguration);
var serviceEndpoint = new ServiceEndpoint(ContractDescription.GetContract(typeof(T)), netHttpBinding, endpointAddress);
var channelFactory = new ChannelFactory<T>(serviceEndpoint);
break;
}
}
也能正常工作,但现在我需要设置的行为为好。在配置文件中,Endpoint有一个behaviorConfiguration属性,这需要在上面设置,这是如何完成的?
HTTPS ://blogs.msdn.microsoft.com/carlosfigueira/2011/06/28/wcf-extensibility-behavior-configuration-extensions/ –