Hi,
I've got strange error on computer which is accessing web-service thrugh proxy.
Scenario 1
----------
- the web-service does not require authentication (Anonymous access is allowed)
- client works fine
Scenario 2
----------
- web-service requires authentication (Intergrated Win. auth / Basic auth.)
- client fails on 401 : Access Denied even though correct credentials are supplied
Scenario 3
----------
- same as Scenario 2, but from client who's not using proxy
- client works fine
It seems as if just the combination of proxy & site which requires authentication was creating the problem.
I tried everything, wirh with default proxy (System.Net.GetDefaultProxy), create my own, pass credentials using just NetworkCredentials, using CredentialsCache... Nothing helped so far.
This is sample code:
// --- my web-service proxy
ProbePX wspx = new ProbePX();
// --- setting up the proxy
wspx.Proxy = System.Net.WebProxy.GetDefaultProxy();
wspx.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
//wspx.Proxy.Credentials = new System.Net.NetworkCredential( txtPxUser.Text, txtPxPwd.Text, txtPxDomain.Text );
// --- setting up the credentials for the web-service
System.Net.CredentialCache cache = new System.Net.CredentialCache();
cache.Add(new Uri(wspx.Url), "Negotiate", new System.Net.NetworkCredential( txtAuthUser.Text, txtAuthPwd.Text, txtAuthDomain.Text ));
wspx.Credentials = cache;
--
Vlad