2014-09-25 101 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); 
}