I have web service, which use integrated security in IIS. Now, I want to test my web service. I created a console application and adding web reference. now, when i m trying to use web method. It show 401 error. m i missing any authentication. I think i need to pass user name and password programatically. can anyone direct me in right direction.
A:
You need to add your windows id on your desktop to the allowed users in IIS.
C. Ross
2009-04-30 16:50:16
I can pass credential to pop up window, which appear on browser before accessing web service, and it work fine.Now, i created a test console application, where i added web reference. and discover web service. But when i try to use web method within test application, it shows 401 error in cosole.
2009-04-30 16:53:30
+2
A:
Set the web service credentials to the System.Net.CredentialCache.DefaultCredentials in your console app
MyWebService proxy = new MyWebService();
proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
Edit
pass credentials programmatically:
MyWebService proxy = new MyWebService();
proxy.Credentials = new System.Net.NetworkCredential("username", "password", "domainname");
Michael Kniskern
2009-04-30 16:52:47
I have domainName\username and passwored.how can i pass these credential programatically?
2009-04-30 16:59:08
Are you referencing the web service on your local workstation or a remote server?
Michael Kniskern
2009-04-30 17:00:50
You can used the first solution if you are trying to debug a web service on your local workstation
Michael Kniskern
2009-04-30 17:22:00