E
Eric
I have the following situation:
An ASP.NET 2.0 app calls a web service, running on TestBoxB. When I run the
app (as a virtual directory) from DevBoxA, everything is fine. When I
create a new website on TextBoxB to host my app, and it calls the web
service on a different site also on TestBoxB, I get nothing but "The Request
Failed with HTTP 401: Unauthorized" messages back.
One thing we noticed is that if you bring up IE and type in the URL of the
ASMX file for the web service, it works fine if you do it from a box OTHER
than TestBoxB. However, if you log in to TestBoxB and perform the same
test, it asks for login credentials and wont accept any tried so far (keeps
asking for credentials over and over).
The settings for the website on TestBoxB are the same as the virtual
directory on DevBoxA: No Anonymous access and Integrated Windows
Authentication. We have tested both with Anonyous access ON and OFF with no
change in behavior.
On both boxes, the IIS application pool that runs the application has an
identity of Network Service.
All of the following code snippets have been tried with the same results:
svc.PreAuthenticate = false;
svc.Credentials = System.Net.CredentialCache.DefaultCredentials;
svc.CallSomeMethod("foo");
//----------------------------------------------
svc.PreAuthenticate = true;
svc.Credentials = System.Net.CredentialCache.DefaultCredentials;
svc.CallSomeMethod("foo");
//----------------------------------------------
System.Net.CredentialCache cache = new System.Net.CredentialCache();
cache.Add(new Uri(svc.Url), "Negotiate", new
System.Net.NetworkCredential("myAccount", "MyPassword", "MyDomain"));
svc.Credentials = cache;
svc.CallSomeMethod("foo");
//----------------------------------------------
Does anyone have any ideas?
Thanks,
Eric
An ASP.NET 2.0 app calls a web service, running on TestBoxB. When I run the
app (as a virtual directory) from DevBoxA, everything is fine. When I
create a new website on TextBoxB to host my app, and it calls the web
service on a different site also on TestBoxB, I get nothing but "The Request
Failed with HTTP 401: Unauthorized" messages back.
One thing we noticed is that if you bring up IE and type in the URL of the
ASMX file for the web service, it works fine if you do it from a box OTHER
than TestBoxB. However, if you log in to TestBoxB and perform the same
test, it asks for login credentials and wont accept any tried so far (keeps
asking for credentials over and over).
The settings for the website on TestBoxB are the same as the virtual
directory on DevBoxA: No Anonymous access and Integrated Windows
Authentication. We have tested both with Anonyous access ON and OFF with no
change in behavior.
On both boxes, the IIS application pool that runs the application has an
identity of Network Service.
All of the following code snippets have been tried with the same results:
svc.PreAuthenticate = false;
svc.Credentials = System.Net.CredentialCache.DefaultCredentials;
svc.CallSomeMethod("foo");
//----------------------------------------------
svc.PreAuthenticate = true;
svc.Credentials = System.Net.CredentialCache.DefaultCredentials;
svc.CallSomeMethod("foo");
//----------------------------------------------
System.Net.CredentialCache cache = new System.Net.CredentialCache();
cache.Add(new Uri(svc.Url), "Negotiate", new
System.Net.NetworkCredential("myAccount", "MyPassword", "MyDomain"));
svc.Credentials = cache;
svc.CallSomeMethod("foo");
//----------------------------------------------
Does anyone have any ideas?
Thanks,
Eric