Friday 6 December 2013

A query to retrieve form data cannot be completed because this action would violate cross-domain restrictions. Infopath web service error

"A query to retrieve form data cannot be completed because this action would violate cross-domain restrictions. If this form template is published to a SharePoint document library, cross-domain access for user form templates must be enabled under InfoPath Forms Services in SharePoint Central Administration, and the data connection settings must be stored in a UDC file in a data connection library in the same site collection."

Recently I had come up with this issue when I try to use InfoPath form to submit data to a web service that hosted in my own server. And got the above error while opening the form. Finally I got the steps to resolve this.

Resolution Steps

1. Make sure that 'Allow user form templates to use authentication information contained in data connection files' in Central Admin is enabled

2.  Create a Data Connection Library in your site.

3. Convert the Data Connection to .udcx file as shown in the below picture


4. Give the path to data connection library


Publish the form to the SharePoint site.
Hope this helps...