I am trying to call UserProfile Service from Infopath 2010 to poulate user details on Form Load.

I get the following error in browser

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

Checking ULS logs I get the following error

Data adapter failed during OnLoad: The remote server returned an error: (401)

Please help me on this

  • Did you follow any specific blog or article when setting up the connection to the user profiles? Commented Feb 5, 2016 at 8:09

1 Answer 1


Solution for the issue is.

  1. Install this hotfix (you may already have this hotfix in your farm) on all WFEs. This is necessary so that the “userName()” function in InfoPath will return a result in domain\username format, instead of just username.
  2. In SharePoint Central Administration, create a new “Group” Secure Store App, assign “All Authenticated Users” as the membership condition, and set the credentials to a user with permissions to access user information for all site users (i.e. a site admin).
  3. In the UDCX file for the data connection calling the “GetUserProfileByName” web service method, add the Secure Store App information and reapprove:

        <udc:SSO AppId="GetUserProfileByNameSSA" CredentialType="NTLM" />
  4. In the form template, in design mode, modify the “GetUserProfileByName” data connection so it does not initialize on load.

  5. In the “Form Load” rule, add actions to set the “AccountName” query field of the “GetUserProfileByName” data connection to the “userName()” function, and then query the data connection.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.