1

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? – Christoffer Feb 5 '16 at 8:09
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:Authentication>
        <udc:SSO AppId="GetUserProfileByNameSSA" CredentialType="NTLM" />
    </udc:Authentication>
    
  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.

http://blogs.technet.com/b/saantil/archive/2013/03/29/an-error-occurred-while-trying-to-connect-to-a-web-service.aspx

https://social.msdn.microsoft.com/Forums/en-US/544a81dc-214a-4caf-aa42-fc9dec796882/webservice-call-fails-from-infopath-webbased-form?forum=sharepointcustomizationlegacy

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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