NetworkCredential UseDefaultCredentials not working NetworkCredential UseDefaultCredentials not working asp.net asp.net

NetworkCredential UseDefaultCredentials not working


If I understood you correctly then I think you need to add keys for your Account, User Name and Password under appSettings in the config file.

<appSettings>    <add key="YourDomain" value="yourAccount"/>    <add key="UserName" value="yourAccount"/>    <add key="Password" value="yourAccount"/></appSettings>

After that in your code,

EmployeeService prxy = new EmployeeService();prxy.Credentials = new System.Net.NetworkCredential(System.Configuration.ConfigurationManager.AppSettings["UserName"].ToString(), System.Configuration.ConfigurationManager.AppSettings["Password"].ToString(), System.Configuration.ConfigurationManager.AppSettings["YourDomain"].ToString()); //while debug, prxy.UseDefaultCredentials= false here//My soap extension gets executed and resets credentials.prxy.GetEmployee(empId);