Error "The request failed with HTTP status 401: Unauthorized" when performing operations
Who is this article for?Users who see an error when performing various operations.
No elevated access or permissions are required.
This article lists scenarios in which the error may occur and how to resolve it.
1. Issue
OnePlaceMail defaults to using the currently logged in credentials (user's Windows credentials) to authenticate with SharePoint.
If the user has specified non-default credentials in OnePlaceMail Settings, these will take precedence.
If the user account does not have the correct level access to the specific SharePoint location, you will receive these errors. As OnePlaceMail enforces SharePoint security, a user will require at least Contributor level of access to be able to upload files to a SharePoint list/library using OnePlaceMail.
Below is a list of scenarios in which the error can occur.
Scenario 1
Adding a site collection URL (in Outlook, under the menu OnePlaceMail Settings dialog) and clicking the Check URL link will generate the error.
Details of the error message displays the following content:
An error has occurred connecting to this SharePoint url. Please re-enter a valid url to a SharePoint site collection.
Possible Causes:
* Server is currently not available
* Site collection url is invalid (url to site collection, site, document library or list are acceptable)
* You do not have access to this site collection
Error: The request failed with HTTP status 401: Unauthorized.
Application: System.Web.Services
Method: System.Object[] ReadResponse(System.Web.Services.Protocols.SoapClientMessage, System.Net.WebResponse, System.IO.Stream, Boolean)
Stack Trace: 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 FileToWSSOutlookAddIn.FileToWSSService.FileToWSS.GetSiteCollectionUrl()
at FileToWSSOutlookAddIn.siteCollectionRow.verifyUrl_Clicked(Object sender, EventArgs e)
Scenario 2
Managing OnePlaceMail folders (under the Manage My OnePlaceMail Folders dialog) and attempting to expand a site collection will prompt this error message.
Details of the error message displays the following content:
An error has occurred retrieving site information for the site collection: http://portal86. Some libraries/lists for this site collection may not be available for selection.
Possible Causes:
* Server is currently not available
* Site collection URL is invalid (check OnePlaceMail configuration)
* You do not have access to this site collection
Error: The request failed with HTTP status 401: Unauthorized.
Application: System.Web.Services
Method: System.Object[] ReadResponse(System.Web.Services.Protocols.SoapClientMessage, System.Net.WebResponse, System.IO.Stream, Boolean)
Stack Trace: 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 FileToWSSOutlookAddIn.FileToWSSService.FileToWSS.GetSiteCollectionSites(String colURL)
at FileToWSSOutlookAddIn.AddSharepointFolder.a(String A_0, TreeNode A_1)
at FileToWSSOutlookAddIn.AddSharepointFolder.a(Object A_0, TreeViewEventArgs A_1)
Scenario 3
Transferring an email/attachment from Outlook using:
- Drag/drop to a OnePlaceMail folder.
- Move to SharePoint button.
- Copy to SharePoint button.
- Send & File button.
will display the following error message:
Details of the error message displays the following content:
An error has occurred accessing the SharePoint Server.
Error: The request failed with HTTP status 401: Unauthorized.
Application: System.Web.Services
Method: System.Object[] ReadResponse(System.Web.Services.Protocols.SoapClientMessage, System.Net.WebResponse, System.IO.Stream, Boolean)
Stack Trace: 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 FileToWSS.GetOnePlaceMailReleaseNumber()
at a4.d(String A_0)
Scenario 4
You are able to initiate a OnePlaceMail upload, complete the destination filing location, and complete and meta-data on the File Upload Window.
Clicking the Upload button in the File Upload Window, you receive the following error.
Details of the error message displays the following content:
An error has occurred uploading the file to SharePoint.
Error: The request failed with HTTP status 401: Unauthorized.
Application: System.Web.Services
Method: System.Object[] ReadResponse(System.Web.Services.Protocols.SoapClientMessage, System.Net.WebResponse, System.IO.Stream, Boolean)
Stack Trace: 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 FileToWSS.UploadDocumentWithResults(String fileName, Byte[] fileContents, String pathFolder, String[] metaData, Boolean overwrite, Boolean autoCheckin)
at ai.a(XmlNode A_0, String A_1, String A_2, String A_3, String[] A_4, FileToWSS A_5, String A_6, Boolean A_7, String A_8)
2. Resolution
In order for OnePlaceMail to automatically pass default Windows user credentials to the SharePoint server, the SharePoint site must be added to either your Local Intranet Zone or the Trusted Sites Zone in Internet Explorer.
To add a SharePoint site to the Trusted Sites Zone:
- Start Internet Explorer.
- Open your SharePoint site.
- Double click the web content zone icon (located in the bottom right of your browser window).
- Highlight Trusted sites.
- Click the Sites... button.
- Add the URL of your SharePoint site.
- Click the Add button, then Close.
If you are accessing a https:// site, add both the https:// and http:// url to the trusted zone.