有人可以告诉我,在生成的wcf客户端中,如何为网络代理和实际服务端点设置单独的凭据?所以我有How to set proxy credentials to specific wcf client?中的类似情况,但我需要对代理进行不同的身份验证,而不是对Web服务端点进行身份验证:
var b = client.Endpoint.Binding as BasicHttpBinding;
/// [...]
b.Security.Mode = BasicHttpSecurityMode.Transport;
b.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic; // !!!
b.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Basic; // !!!
client.ClientCredentials.UserName.UserName = login;
client.ClientCredentials.UserName.Password = password;
那么我的proxyLogin
和proxyPassword
放在哪里?有什么想法吗?