afroblanca
Programmer
Here's the situation :
I have the same asp.net 2.0 web application running on both Machine A and Machine B. On both machines, I have Integrated Windows Authentication turned on, and Anonymous Access turned off. When I hit a certain page on Machine A, it will call the web service on Machine A, and then it will call the same web service on Machine B. Likewise, when I hit the same page on Machine B, it will call the web service on Machine B, and then it will call the same web service on Machine A.
On both machines, I have an account set up for this web service to use. The username/password for Machine A is different from the username/password for Machine B. The machines are on different Active Directory domains.
The websites on Machine A and Machine B use the same second-level domain, but have different subdomains.
On the page that calls the webservice, I have a block of code that looks like this :
try
{//call the webservice on Machine A
CacheMaintenance maintain = new CacheMaintenance("local.mysite.com");
maintain.Credentials = new NetworkCredential("LocalLoginName", "LocalPassword", "LocalDomain");
maintain.FlashTheCache();
maintain.Dispose();
}
catch (Exception exp)
{
errors = "Could not flash local cache. " + General.UnrollException(exp) + " ";
}
try
{//call the webservice on Machine B
CacheMaintenance maintain = new CacheMaintenance("testlive.mysite.com");
maintain.Credentials = new NetworkCredential("TestLiveLoginName", "TestLivePassword", "TestLiveDomain");
maintain.FlashTheCache();
maintain.Dispose();
}
catch (Exception exp)
{
errors += "Could not flash live cache. " + General.UnrollException(exp);
}
Machine A has no problem calling the webservice on Machine B. Likewise Machine B has no problem calling the webservice on Machine A. However, when Machine A tries to call the webservice on Machine A, or when Machine B tries to call the webservice on Machine B, I get a "401 Not Authorized" error.
Does anybody know why I'm getting this error?
Thanks for your help.
I have the same asp.net 2.0 web application running on both Machine A and Machine B. On both machines, I have Integrated Windows Authentication turned on, and Anonymous Access turned off. When I hit a certain page on Machine A, it will call the web service on Machine A, and then it will call the same web service on Machine B. Likewise, when I hit the same page on Machine B, it will call the web service on Machine B, and then it will call the same web service on Machine A.
On both machines, I have an account set up for this web service to use. The username/password for Machine A is different from the username/password for Machine B. The machines are on different Active Directory domains.
The websites on Machine A and Machine B use the same second-level domain, but have different subdomains.
On the page that calls the webservice, I have a block of code that looks like this :
try
{//call the webservice on Machine A
CacheMaintenance maintain = new CacheMaintenance("local.mysite.com");
maintain.Credentials = new NetworkCredential("LocalLoginName", "LocalPassword", "LocalDomain");
maintain.FlashTheCache();
maintain.Dispose();
}
catch (Exception exp)
{
errors = "Could not flash local cache. " + General.UnrollException(exp) + " ";
}
try
{//call the webservice on Machine B
CacheMaintenance maintain = new CacheMaintenance("testlive.mysite.com");
maintain.Credentials = new NetworkCredential("TestLiveLoginName", "TestLivePassword", "TestLiveDomain");
maintain.FlashTheCache();
maintain.Dispose();
}
catch (Exception exp)
{
errors += "Could not flash live cache. " + General.UnrollException(exp);
}
Machine A has no problem calling the webservice on Machine B. Likewise Machine B has no problem calling the webservice on Machine A. However, when Machine A tries to call the webservice on Machine A, or when Machine B tries to call the webservice on Machine B, I get a "401 Not Authorized" error.
Does anybody know why I'm getting this error?
Thanks for your help.