2014-09-25 102 views

回答

1

*通配符指示使用第一个限定端点,因为对同一合同您可以有多个端点。我在MSDN上找不到任何这方面的参考,但可以看到它在​​内部使用。反编译使用Dotpeek,意见我的

protected void InitializeEndpoint(string configurationName, EndpointAddress address) 
{ 
    this.serviceEndpoint = this.CreateDescription(); 
    ServiceEndpoint serviceEndpoint = (ServiceEndpoint) null; 
    if (configurationName != null) 
    // ConfigLoader checks whether the passed configurationName is a wildcard match 
    // and uses it when looking up channels from configuration to determine 
    // which channel to use 
    serviceEndpoint = ConfigLoader.LookupEndpoint(configurationName, address, this.serviceEndpoint.Contract); 
    if (serviceEndpoint != null) 
    { 
    this.serviceEndpoint = serviceEndpoint; 
    } 
    else 
    { 
    if (address != (EndpointAddress) null) 
     this.Endpoint.Address = address; 
    this.ApplyConfiguration(configurationName); 
    } 
    this.configurationName = configurationName; 
    this.EnsureSecurityCredentialsManager(this.serviceEndpoint); 
}