The request failed with HTTP status 401: Unauthorized. On a server where other apps use the same service fine
Ok I have a few web apps running on a server. We will call them A, B and C. A and B have been modified to use a webservice which does some logging. I am now trying to add this webservice to app C but I am getting the above error. I decided to experiment. I took all of the code from app B which runs everything fine and remove it. I then took app C and placed that code in that directory to make sure it is not a setting issue with the virtual directory. App C still does not work and I am running out of ideas. The code has been compiled in both .NET 2.0 and 3.5 with the same results.
Code for reference. I have also tried passing in my credentials, this line was left out from below.
UserLogService.UserActivity TestService = new UserLogService.UserActivity();
TestService.PreAuthenticate = false;
TestService.Credentials = System.Net.CredentialCache.DefaultCredentials;
TestService.InitializeUserActivity();
ReturnValue = TestService.LogEntry("US043401", "VOL", "DQIF", "DEFAULT.ASPX",
"Data Source Id=" + ddlDat开发者_Go百科asource.SelectedItem, "Data Feed Id="
+ ddlDataFeed.SelectedItem).ToString();
At the risk of suggesting the obvious, what do the server logs say?
精彩评论