If you are having problems running an Infopath 2010 web form that uses GetUserProfileName and the web application uses claims based authentication with windows authentication (NTLM) and you check the log file and you see an error message like the one below.
The following query failed: GetUserProfileByName (User: 0#.w|domain\user, Form Name: Nameoftheform, IP: , Connection Target: , Request: http://site/_layouts/FormServer.aspx?…….. The remote server returned an error: (401) Unauthorized. The remote server returned an error: (401) Unauthorized.)
Disable ASP.NET impersonation under “Authentication Providers” for the web application in IIS.