locked
infopath error using UserProfileService.asmx in sharepoint 2007 RRS feed

  • Question

  • Hi

    I think i got a similar error.

    I have an infopath form using UserProfileService.asmx web service to retrieve the account name and account id, but when i open the form in the browser (IE) i got the same mistake as you. Not when i open the form, but when i click on the "Save" button which has three rules which the first one set some fields a value and then makes a query using this service and the "GetUserProfileByName" method.

    I tried to open it using the infopath client application and when i click on the "Save" button the error says: "The query could not be run for the data object: GetUserProfileByUserName. Infopath could not run the specified query. A user with the account name "<user>" could not be found -> user not found. Could not load profile data from the database."

    Now, the user could not be found is not me, or either the users named in the form. Is a user who doesn't even exists (neither in sharepoint nor in AD). This user developed this application. Now, when i look the data conecction to this method of the web service, there's no parameter passed through the service, it's value is null, because you don't need to pass a parameter.

    It's like the service is always trying to retrive the user profile for this unique user, which doesn't exist anymore.

    Is it possible that this web service is running under this user which doesn't exists anymore, for i should change it? If so, where is it configured?

    How is it possible then?

    Does anybody faced this problem before?

     

    Thanks


    Regards, Joel Di Rosa
    Tuesday, January 3, 2012 6:34 PM

Answers

  • I've solved this issue.

    The thing was that this web service was trying to retrieve the profile of a user hardcoded in the form, which i figured out opening the form (the .xml file) with Microsoft Sharepoint Designer. All of these forms are original form for several users. The user was indicated with the same id (belong to another user, the one who developed this).

    So, the web service was retrieving data for this unique user, which no longer exists, and therefore drops an error.

    I had to edit every single form, using the .xml file of the form and opening it with SD to change the id of every user.

     

    I should kill the person who developed this.

     

    Thank you all for your answers.

    I will close this.


    Regards, Joel Di Rosa
    • Marked as answer by Joel Di Rosa Thursday, February 2, 2012 6:27 PM
    Thursday, February 2, 2012 6:27 PM

All replies

  • Hi, You van have a good example of the "GetUserProfileByName" webservice with this post of Clayton Cobb : http://claytoncobb.wordpress.com/tag/getuserprofilebyname/

    If I remember, if you don't put the parameter, it will use the current user that is connected.

    In InfoPath Forms Services, it used the SharePoint login.

    With a client InfoPath Form, it use the window session login.

     

    Have you check that all your accounts are already in the User Profile service? (the webservice is querying this service).

    If your user profile database is empty, you will get the same kind of error that you have. Hope this helps.


    Visit my blog : http://rmatayron.blogspot.com/

    Tuesday, January 3, 2012 8:58 PM
  • If i open the form using Infopath Form Services, i got "An error occurred accessing a data source".

    But, if i open it using the Infopath client, using my windows login, i got the error described above that "A user with account name "Domain\Name" (which is not me) could not be found". Is like is trying to retrieve the user profile of that unique user.

    Besides, that user doesn't exists anymore, it doesn't have any permissions nor belongs to any sharepoint group, is not member of any AD group anymore, nothing. It seems that somewhere that user is harcoded, if not why is always trying to retrive his profile and not the logged one ?


    Regards, Joel Di Rosa
    Tuesday, January 3, 2012 9:45 PM
  • Hi Joel,

     

    Please check the security level of your form by going to Tools–>Form Options–>Select “Security and Trust ”.

     

    Cause user cannot submit a form to SharePoint if the security level is  ‘Restricted’. And this article is about the similar error, you can refer to it:

     

    http://techbrij.com/768/an-error-occurred-accessing-a-data-source-infopath-moss-2007

     

    Hope this helps.

     

    Thanks.


    Pengyu Zhao

    TechNet Community Support

    • Marked as answer by Pengyu Zhao Friday, January 13, 2012 1:15 AM
    • Unmarked as answer by Joel Di Rosa Thursday, February 2, 2012 6:23 PM
    Wednesday, January 11, 2012 7:05 AM
  • I've solved this issue.

    The thing was that this web service was trying to retrieve the profile of a user hardcoded in the form, which i figured out opening the form (the .xml file) with Microsoft Sharepoint Designer. All of these forms are original form for several users. The user was indicated with the same id (belong to another user, the one who developed this).

    So, the web service was retrieving data for this unique user, which no longer exists, and therefore drops an error.

    I had to edit every single form, using the .xml file of the form and opening it with SD to change the id of every user.

     

    I should kill the person who developed this.

     

    Thank you all for your answers.

    I will close this.


    Regards, Joel Di Rosa
    • Marked as answer by Joel Di Rosa Thursday, February 2, 2012 6:27 PM
    Thursday, February 2, 2012 6:27 PM