none
Error 5566 - Infopath form to GetUserProfileByName

    Question

  • I have tried everything I can find to fix this but not having any luck....:(

    I have a multi server farm (2 WFE, 2 APP, 1 Load Balancer)

    Infopath Form: Created an infopath form that calls the userprofileservice.asmx for method GetUserProfileByName (the data connection is called CreateUserProfileByName in Infopath)

    Web Application: Have tried classic and claims with NTLM and Kerberos (nothing works)

    Browser : IE 8

    The form works fine in Infopath itself. However when published to the server I get the dreaded 5566 error. Pretty much have exhausted all suggestions from the web.

    The error message in ULS is - The following query failed: CreateUserProfileByName (User: Domain\MyFirstName.MyLastName, Form Name: Template, IP: , Connection Target: http://spsite/sites/SiteRequest/ConnectionLibrary/file.udcx, Request: http://spsite/sites/SiteRequest/Lists/Requests/AllItems.aspx, Form ID: urn:schemas-microsoft-com:office:infopath:list:-AutoGen-2012-08-28T23:06:23:223Z Type: DataAdapterException, Exception Message: The remote server returned an error: (401) Unauthorized. The remote server returned an error: (401) Unauthorized.)

    • Tried using a udcx file with a hard coded username and password
    • Tried using secure store service
    • Tried disabling ASP.Net impersonation
    • Tried with NTLM first and then with Kerberos Web App
    • Tried both claims and classic authentication ( guess the former does not work with infopath)
    • Made sure loopback was disabled on all servers
    • Have ensured I can get to the webservice directly in a browser
    • Hosts files on the WFEs point to themselves

    Nothing works...:(....any ideas?

    Thanks in advance,
    Jake.




    • Edited by jacobUT Friday, August 31, 2012 6:19 PM
    Friday, August 31, 2012 4:44 PM

Answers

  • Hi All,

    Just an update. Finally after some network tracing I realized this was related to the fact that the request was going through the proxy. Strange thing was that even after disabling the proxy in IE, the system was still routing through the proxy. Then I recalled a post or two that talked about this in the numerous numerous Internet searches recommendations that I had already attempted. And sure enough that seemed to fix the issue.

     <system.net>
       <defaultProxy>
         <proxy autoDetect="false" />
       </defaultProxy>
    </system.net>

    Needless to say, the edit should be done through a feature. Anyway, hope this helps someone else also.

    Thanks,
    Jake.


    Monday, September 3, 2012 2:58 AM

All replies

  • Do you have a site collection at http://spsite?  Have you tried giving the user accessing the form read access to that root site?

    http://sharepoint.nauplius.net

    Friday, August 31, 2012 5:54 PM
    Moderator
  • Hi Trevor,

    There is a root site collection but general users dont have read permissions there. I am invoking the web service from the sitecollection level in the URL rather than the root site collection.

    so my _vit_bin url is relative to the site collection I am testing from rather than the root site collection.

    After I read your email I added read permissions to all authenticated users at the root site collection. However, this has not made a difference....

    Thanks,
    Jake.


    • Edited by jacobUT Friday, August 31, 2012 6:25 PM
    Friday, August 31, 2012 6:24 PM
  • Hi!

    Two possible errors:

    1. Infopath does not impersonate the current user and uses the app pool account. In  this case the app pool account is not allowed to access user profile data.

    2. InfoPath impersonates the current user. In the case the current user is not allowed to acces user profile data.

    Just try to enable users (test user, app pool account) with read access or "full control" *for testing purpose only*. In CA => App Management => Service Apps => User Profile Service App => (select them) => Ribbon: Administrators / Permissions.

    If you figured out reduce the set of rights to it's minimum by "trial-and-error".

    Regards
    Ingo

    Friday, August 31, 2012 6:44 PM
  • Hi All,

    Just an update. Finally after some network tracing I realized this was related to the fact that the request was going through the proxy. Strange thing was that even after disabling the proxy in IE, the system was still routing through the proxy. Then I recalled a post or two that talked about this in the numerous numerous Internet searches recommendations that I had already attempted. And sure enough that seemed to fix the issue.

     <system.net>
       <defaultProxy>
         <proxy autoDetect="false" />
       </defaultProxy>
    </system.net>

    Needless to say, the edit should be done through a feature. Anyway, hope this helps someone else also.

    Thanks,
    Jake.


    Monday, September 3, 2012 2:58 AM
  • I'm having the same error, but I'm using Sharepoint Online (Office 365) not locally, any idea how I can fix this on SP online?

    Thanks.

    Monday, November 10, 2014 5:44 PM
  • Hi,

    I have the same problem on SharePoint 2013, i tried many ways (created for Secure Store Target Application, ...)  but in vain. did we have any other way to resolve this error or we shouldn't use 'GetUserProfileByName' in InfoPath form in SharePoint 2013?

    Thank you,

    Halim EL BORGI

    Wednesday, February 4, 2015 10:13 AM
  • I'm having the same error, but I'm using Sharepoint Online (Office 365) not locally, any idea how I can fix this on SP online?

    Thanks.


    I have this same problem, I tried, creating the Secure Store Target in the Sharepoint administration, also I tried setting the credentials in the udcx file but nothing... all of this in Ofifice 365, did you solve your problem?
    Wednesday, February 11, 2015 6:32 PM