We used "Userprofileservice" in infopath form to populate user’s details. It works perfectly on client form but once convert to UDC and open in the web form. It gets error:

A runtime exception was detected. Details follow.
Message: The remote server returned an error: (503) Server Unavailable.

Techinal Details:
System.Net.WebException: The remote server returned an error: (503) Server Unavailable.
   at System.Net.HttpWebRequest.GetResponse()

I know this is proxy error but still spent hours trying to solve the problem. Here are the list you need to check:

A. Disable the authentication loopback check

Re-enable the behavior that exists in Windows Server 2003 by setting the DisableLoopbackCheck registry entry in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa registry subkey to 1. To set the DisableLoopbackCheck registry entry to 1, follow these steps on the client computer:

  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
  3. Right-click Lsa, point to New, and then click DWORD Value.
  4. Type DisableLoopbackCheck, and then press ENTER.
  5. Right-click DisableLoopbackCheck, and then click Modify.
  6. In the Value data box, type 1, and then click OK.
  7. Exit Registry Editor.
  8. Restart the computer.

B. Enable the Web Service Proxy for InfoPath Service in Central Admin


C.  Make sure the “UseFormsServiceProxy” attribute is set to True


D. Check the Proxy Setting in web.config, and I added the url in the bypasslist that look like our SPNs aren’t set up correctly.

      <proxy usesystemdefault="false" proxyaddress="http://xx.xx.xx.xx:8080/" bypassonlocal="true" />
         <add address="moss.company.local" />

Incidentally, the <bypasslist> element allows you to use Regular Expression like “xxx.xxx*” to specify addresses, so you can exclude whole ranges at will – quite neat.

NB: Remember to IISREST or recycle to clear the server cache