By: Kathryn Bartlett
When you are connecting a WCF Service to an InfoPath form and happen to come across the following error:

To resolve this, you need to do the following two steps:
1. Enable cross-domain access for InfoPath Forms
2. Store the data connection in a UDC file on your SharePoint site.
Enabling Cross-Domain Access
Go to “General Application Settings” in Central Administration and click on “Configure InfoPath Forms Services”.

Check “Allow cross-domain data access for user form templates that use connection settings in a data connection file”

Hit OK.
Storing the Data Connection in a UDC File
First, create a Data Connection Library on your SharePoint site.
Copy the URL of this library up to, but not including, the /Forms/AllItems.aspx.
In Infopath, go to your Data Connections, and select your WCF Data Connection. Click “Convert to Connection File…”

Enter the URL to your data connection library and append ‘/’ followed by a file name of your choice with extension udcx. Leave the Connection link type as the default and hit OK.

Now go to your data connection library, select the “Approve/Reject” option from the dropdown of your file, and select “Approve”.
Publish your form and it should open with no problem.
By: Kathryn Bartlett