InfoPath SharePoint FormServer error 5566

The Error code 5566 is very common, and if you get that error

“ An error occurred querying a data source.

Click OK to resume filling out the form. You may want to check your form data for errors.
 Hide error details
 System.Xml.XmlException: There are multiple root elements. Line 2, position 2 ……………………..  “

Code 5566 is a very common error when performing cross web services calls

The Problem is more of a server architecture issue ( on a single sever farm configuration you may not have those issues)

The Root causes

  1. Name resolution
  2. Certificate validation errors
  3. UAG or any Url Filter or traffic parsing engines (F5 Big-IP and the like.)

The cause can be one or all of the above.

Simply to understand the problem, you need to understand how InfoPath handles this type of traffic.

  1. Client ( C  ) requests a form operation from form server ( S )
  2. S read the template from the same server or the document library or storage .
  3. S builds a temp map in memory for the current user of the form rules and code for the duration of the session.
  4. S Execute the operation (read, update, or new) form.
  5. C render on InfoPath Client or Browser (thin client )
  6. S terminates session.

Where things break

At steps 1, 2, 3 and 4

Problem Solution
1 [1] C resolve the server as [IP x.y.z.w] but Sresolves as different IP and server encounter a template or form load error but does not report it to the user Try to browse the data connection urls from the server itself  and check if you encounter any problem , resolve accordingly(In some cases internal DNS record does not match the proper configuration  use hosts file entry to manually force the session to the same server)
2 [1] If you are behind a proxy or load balanced farm Try to configure it so that the server sessions are bound to a single server for the same client.
3 [1] If you are using a public name and internal name using AAM Make sure you are resolving the correct IP inside and outside the proxy/firewall see Item 1
4 [2] S can’t load the form or the template That should not cause 5566 but it will be more descriptive If you are using a proper proxy configuration , but in some cases where the proxy configuration is not correct this will show as error 5566
5 [3] If you have dynamic links for services that gets compiled at load You need to debug this by loading this form on the same server.
6 [3] If you are using SSL certs Make sure your server can validate the certificate or disable certificate validation.
7 [4] If read new or  update  operation Check the on load rules and see if those generate certain other web services or list connections that cause this issue and handle as in item 1 above

Best of Luck

Infopath Workflow The form has been closed. form cannot be found



Page error

The form has been closed.


Error Log

Exception occurred during request processing. (User: XXX\Jackson, Form Name: , IP: , Request: http://portalsites-test2/_layouts/IniWrkflIP.aspx?List=3f3aea57-9808-4d6f-8ae8-658677abc7d4&ID=2&TemplateID={79cf7b35-6830-4c20-885a-eb8f519bc298}&Source=http://portalsites-test2/sites/it-appdev/TestSite/DocumentTest/Forms/AllItems.aspx, Form ID: , Type: InfoPathLocalizedException, Exception Message: The specified form cannot be found.)

My fix :