Can somebody tell me how, in a generated wcf client, to set separate credentials for the network proxy and the actual service endpoint? So I have a simlar situation as in How to set proxy credentials to specific wcf client?, but I need to authenticate differently to the proxy than to the web service endpoint:
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;
So where to put my proxyLogin
and proxyPassword
? Any ideas?