Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Web Service 401: Unauthorized Error
- // Webservice
- IdentityService ws = new IdentityService();
- // Test Static Credentials
- string username = "twfnf";
- string password = "testme99";
- string domain = "testapps1";
- NetworkCredential credentials = new NetworkCredential(username, password, domain);
- CredentialCache credCache = new CredentialCache();
- credCache.Add(new Uri(ws.Url), "Basic", credentials);
- ws.Credentials = credCache;
- ws.PreAuthenticate = true;
- ws.AuthenticateUser();
- CredentialCache credCache = new CredentialCache();
- credCache.Add(new Uri(ws.Url), "Basic", credentials);
- // Webservice
- IdentityService ws = new IdentityService();
- // Test Static Credentials
- string username = "twfnf";
- string password = "testme99";
- string domain = "testapps1";
- NetworkCredential credentials = new NetworkCredential(username, password, domain);
- ws.Credentials = credentials;
- ws.PreAuthenticate = true;
- ws.AuthenticateUser();
Add Comment
Please, Sign In to add comment