How do I get the user full name using Sharepoint webservice GetUserProfileByName?
I have the following XML that gets generated creating a DataConnection to the Sharepoint webservice GetUserProfileByName (in receive data mode)
<dfs:myFields xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:s0="http://microsoft.com/webservices/SharePointPortalServer/UserProfileService" xmlns:s1="http://microsoft.com/wsdl/types/"><dfs:queryFields><s0:GetUserProfileByName><s0:AccountName>DEFAULTVALUE</s0:AccountName></s0:GetUserProfileByName></dfs:queryFields><dfs:dataFields><s0:GetUserProfileByNameResponse><s0:GetUserProfileByNameResult><s0:PropertyData><s0:Name></s0:Name><s0:Value></s0:Value></s0:PropertyData></s0:GetUserProfileByNameResult></s0:GetUserProfileByNameResponse></dfs:dataFields></dfs:myFields>
I use the variable System.Environment.UserName to get the username, I then want to use it to fetch the user full name using the webservice.
I'm using the following code which does not return the default value for the account name I have setup in my Data Connection:
IXMLDOMNode userProfileInfo = thisXDocument.DataObjects["GetUserProfileByName"].DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/s0:GetUserProfileByName/s0:AccountName");