none
Userprofileservice.asmx With .UDCX File Gives SharePoint Admin Username Instead of First name, Last Name and suchlike.

    Question

  • Hi all,

    I have create an InfoPath form that uses the Userprofileservice.asmx web service to retrieve the information form the AD. I have used a .UDCX file store the data connection.

    I wanted to view the First Name, Last Name and Preferred Name on in some text boxes. So I have used the below filters

    First Name - Value[Name = "FirstName"]
    Last Name - Value[Name = "LastName"]
    Preferred Name - Value[Name = "PreferredName"]

    The XPaths are as below.

    First Name - xdXDocument:GetDOM("GetUserProfileByName 2")/dfs:myFields/dfs:dataFields/tns:GetUserProfileByNameResponse/tns:GetUserProfileByNameResult/tns:PropertyData/tns:Values/tns:ValueData/tns:Value[../../../tns:Name = "FirstName"]

    Last Name - xdXDocument:GetDOM("GetUserProfileByName 2")/dfs:myFields/dfs:dataFields/tns:GetUserProfileByNameResponse/tns:GetUserProfileByNameResult/tns:PropertyData/tns:Values/tns:ValueData/tns:Value[../../../tns:Name = "LastName"]

    Preferred Name - xdXDocument:GetDOM("GetUserProfileByName 2")/dfs:myFields/dfs:dataFields/tns:GetUserProfileByNameResponse/tns:GetUserProfileByNameResult/tns:PropertyData/tns:Values/tns:ValueData/tns:Value[../../../tns:Name = "PreferredName"]

    But when I published the form to SharePoint I get
    First Name - SPPrdAdmin
    Last name - EMPTY
    Preferred Name - SPPrdAdmin

    I cannot understand what I have done wrong.
    Please help me to solve this.

    Thanks

    Wednesday, November 30, 2016 11:22 AM

All replies

  • Hi Chiranthaka- are you using an admin account? Try using an actual user account that has a first & last name.

    cameron rautmann

    Wednesday, November 30, 2016 4:59 PM
  • Hi Cameron,

    Yes I have tried. I have tried a user with Contribute rights and still I am getting the same results, showing only SPPrdAdmin.

    This SharePoint site uses Claims-Based authentication.


    I cannot understand what I have done wrong.
     


    Tuesday, December 6, 2016 11:24 AM