During the initial set-up of SharePoint 2013 adapter with BizTalk 2013 there may be scenario when you get errors such as : The remote server returned an error: (401) Unauthorized.
The adapter failed to transmit message going to send port “XXXX” with URL “wss://ServerXXX:XX/sites/XX/xxxxx/xxxx“. It will be retransmitted after the retry interval specified for this Send Port. Details:”[System.Net.WebException] The remote server returned an error: (401) Unauthorized.
This error was triggered by the Windows SharePoint Services receive location or send port with URI “wss://ServerXXX:XX/sites/XX/xxxxx/xxxx“.
Windows SharePoint Services adapter event ID: 12310”.
When validating you see that the user under which the adapter host is running has all the rights on the web site and the document library and still you see the issue.
Out of curiosity the user is given rights on SharePoint database and WS_WPG groups also but still the problem persists.
The problem here is because the user is not having access to the root of the SharePoint server. In this case to http://ServerXXX:XX.
When BizTalk 2013 WSS adapter tries to access the document library it first tries to access the root and then dives in to the libraries for the action. A look at the SharePoint logs will give the necessary information.
Once the user under which the host of WSS adapter is running gets access to the root site, BizTalk 2013 will start communication to and from SharePoint document libraries. The permission can be the least privileged one .i.e Visitors.