AnimaSola
AnimaSola

Reputation: 7856

System.Net.WebException: The request failed with HTTP status 401: Unauthorized

Ok, so I have this .NET 1.1 application (written by someone way back) which is like a document repository and it worked fine in the past. I suddenly get this error when trying to search for items/documents:

Page: /CPDEPforIT/SearchResults.aspx

Error:

System.Net.WebException: The request failed with HTTP status 401: Unauthorized. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at CPDEPforIT.InktomiSearchService.soapSearchService.getSearchResults(SearchInput in0) at CPDEPforIT.SearchResults.GetDatasetForSearchQuery(SearchInput searchInput) at CPDEPforIT.SearchResults.Page_Load(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain()

I don't remember any changes. Could this have been caused by something external to the application (IIS configurations/permissions, Server, Database)?

Upvotes: 0

Views: 12591

Answers (2)

Pirates007
Pirates007

Reputation: 1

I have also faced this type of issue before. In my case permission to the code folder works. Please check the folder permissions and then try with the IIS permissions.

Upvotes: 0

Trevor
Trevor

Reputation: 8004

There are several things you need to verify.

  1. Does the web service you are trying to access allow Anonymous Access? Authentication can be tricky for web-to-web calls
  2. What is the web application running under, IWAM_xxx or IUSR_xxx? Or are you using an application pool running under a specific identity?
  3. You may want to make sure your web application server's ASPNET or NETWORK SERVICE accounts can access your web service server.

If you want to get it working you could just provide an account for Anonymous Access...

Thanks!

Upvotes: 0

Related Questions