0

I have an InfoPath 2013 form, that fetches some data from external database using a WebService. The WebService is called when the user enters some data in a text field on the form. The WebService returns a set of data.

The form opens perfectly alright in the browser, but when the WebService is called, it throws an error –

“A query to retrieve form data cannot be completed because this action would violate cross-domain restrictions.”

enter image description here

I have done all the possible configuration checks and troubleshooting that I knew or comprehend from various blogs on the net. I have summarised all of them below –

  1. I have already converted all the data connections that are using a web service to retrieve data to .udcx files and saved them to a data connection library in SharePoint. There are 2 data connections that use a list in the same site collection to retrieve data. These 2 data connections have been left as is (i.e. I did not convert these to .udcx)

  2. While publishing I have checked the option for “Enabled this form to be filled out by using browser” Further, this is not an administrator approved form template. I published it for a specific Form Library

enter image description here

  1. I have enabled the Cross domain for InfoPath in the Central Admin.
  2. Moreover, I have enabled the “'Allow user form templates to use authentication information contained in data connection files” in the Central Admin.

enter image description here

  1. I have checked the “State Service” in Central Admin is started

enter image description here

  1. In the “InfoPath Forms Services Web Service Proxy” in Central Admin both the options as below are enabled – a) Enable InfoPath Forms Services Web service proxy b) Enable InfoPath Forms Services Web service proxy for user forms

enter image description here

  1. I have checked the “SharePoint Server Enterprise Site Collection features” in the site collection is active.

enter image description here

Even after all the above settings, I am still not able to overcome this error. This has become a major road block for me.

I would appreciate any help extended to me.

Thanks all.

3 Answers 3

0

Try to enable verbose logging for InfoPath, and check the ULS log for more information. Could be something stupid like you are using another URL that what you think.

1
  • Hi sjkp, I checked the ULS logs, they are clear, there is no indication of any wrong url being used. Besides I re-checked all the UDCX files, all the urls are correctly pointed to within the same domain that I am working in. Is there anything else that I might be missing. Jan 4, 2015 at 23:20
0

You may need to use SSO in your UDCX. Method 2 in this Microsoft Knowledge base article describes how to set up a secure store application and modify the UDCX to use it.

You can specify an SSO or even explicit credentials (not recommended, of course) in the <udc:Authentication> node in your UDCX.

1
  • Tried this, but the issue remains the same. Jan 8, 2015 at 4:05
0

It seems your web services doesn't accept CORS preflight requests.

If you are owner of the webservice code, you could implement the OPTION method to handle that.

Otherwise, try to use BDC to make an external connection on your database directly or by your webservice then you could reuse it in your InfoPath form as datasource.

Regards.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.