question

SharePointGuys-9857 avatar image
0 Votes"
SharePointGuys-9857 asked SharePointGuys-9857 commented

InfoPath form running on SharePoint 2016 gives error: The remote server returned an error: (401) Unauthorized, while try to query _vti_bin/UserGroup.asmx

Hi Expert,

I am converting an InfoPath form from SP2010 into SP2016.

In SP2016, the SharePoint web application (http://sp2016dev:7000) is using Claims Based Authentication.

I deployed the InfoPath form to http://sp2016dev:7000. When I opened the form in IE 11, I received the following error:
An error occurred while trying to connect to a Web service.

  An entry has been added to the Windows event log of the server. 
  Log ID:5566
  Correlation ID:a8e2f59f-4e46-a01b-d1df-6f3a0124b5bb
  --------------------------------------------------------------------------------
  An error occurred while trying to connect to a Web service.
  An entry has been added to the Windows event log of the server. 
  Log ID:5566
  Correlation ID:a8e2f59f-4e46-a01b-d1df-6f3a0124b5bb 

I checked the Windows Event Log, the error shows:

The following query failed: GetGroupCollectionFromUser (User: 0#.w|dev\devaccount07, Form Name: SD407 Form , IP: , Connection Target: http://sp2016dev:7000/site/infopathForms/Data_Connection_Library/WS_GetGroupCollectionFromUser.udcx, Request: http://sp2016dev:7000/_layouts/15/FormServer.aspx?XsnLocation=/site/infopathForms/FormServerTemplates/SD407 Form.xsn&ClientInstalled=false&Source=http://sp2016dev:7000/site/infopathForms/FormServerTemplates/Forms/All%2520Forms.aspx?InitialTabId=Ribbon%252EDocument&VisibilityContext=WSSTabPersistence, Form ID: urn:schemas-microsoft-com:office:infopath:SD407 Form: Type: DataAdapterException, Exception Message: The remote server returned an error: (401) Unauthorized.
The remote server returned an error: (401) Unauthorized.)

About dev\devaccount07:

  • The dev\devaccount07 account is the site collection admin account. I browse the SharePoint site using this account.

  • The userName() function inside the InfoPath form returns "i:0#.w|dev\devaccount07". I note that the above event log shows the account is "0#.w|dev\devaccount07", i.e. missing the prefix "i:"

.

I guess, probably I am wrong:
When the InfoPath form sends a web service request to http://sp2016dev:7000/site/infopathForms/_vti_bin/UserGroup.asmx through the Data Connection library (http://sp2016dev:7000/site/infopathForms/Data_Connection_Library/WS_GetGroupCollectionFromUser.udcx), the user account "0#.w|dev\devaccount07" cannot be authenticated because it missed the prefix "i:"; i.e. it should be "i:0#.w|dev\devaccount07".

I google the solution for days; however, I still don't find any solution.

Please kindly help.












office-sharepoint-server-developmentsharepoint-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

YiLu-MSFT avatar image
0 Votes"
YiLu-MSFT answered SharePointGuys-9857 commented

Hi @SharePointGuys-9857
When you use Claims-based authentication, your user name is prefaced by “0#.w|”. So for example, if your user name is SuesDomain\jdoe then your Claims-based user token will be, without the quotes: “0#.w|SuesDomain\jdoe”

Howerver, InfoPath can’t handle that, or more specifically, the UserProfile.asmx method GetUserProfileByName method can’t handle that. InfoPath tries to pass in your Claims-based user token instead of your domain\User Name.

For more information and solutions, you could refer to:
https://suehernandez.wordpress.com/2013/10/11/sharepoint-2013-infopath-claims-getuserprofilebyname/
https://sharepoint.stackexchange.com/questions/191449/infopath-calls-webservice-log-id5566-401-unauthorized

Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


If an Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @SharePointGuys-9857
Would you plaese provide some update of this issue? I am free to hear.

0 Votes 0 ·

Thank you very much for your help. Much appreciated.

0 Votes 0 ·