Today I needed to get an InfoPath Forms Services web-form to make a call out to a web service. I was non-too pleased to get a cryptic error message from SharePoint when I tried to do this first-off. SharePoint claimed it had written details of the error to the Windows Event Log, but there was nothing to be found there L
Instead I trawled the SharePoint log files and found details of an exception caused by cross-domain data-access not been permitted. Then it was fellow bloggers to the rescue as Joris has a very helpful post explaining that there are in fact two steps required to enable Web Services to work in InfoPath web forms:
The first step makes sense, but why do I need to store a UDC in a Data Connection Library? A couple more searches turned up two great posts from Nick Dallet on the InfoPath Team blog. The first post explains exactly why. The short answer is that it is because HTTP is stateless InfoPath can't interrupt server-side code execution to go back and prompt the user to authorise the cross-domain call. Using a UDC enables this decision to be placed in the hands of the SharePoint administrator at deployment time.
Nick's next article goes on to explain details of UDC files and this bit stood out for me: How you can use the SharePoint SSO (Single-Sign-On) service to pass credentials to the web service you are calling.
Adding Authentication InfoPath does not automatically configure server-only authentication options for you. However, when creating a UDC file, InfoPath automatically creates an authentication block within the UDC file that is preconfigured to use Office Single Sign-on. In order to use this authentication option, you'll need to uncomment the authentication block within the file and add both the SSO application ID and the CredentialType. Most of the time, you'll want to use the SSO credential to log onto Windows, for which you'll need to specify "NTLM" as the CredentialType. The full list of possible credential types is as follows: Value Description Sql Credentials will be embedded in a database connection string for authentication against a SQL server. NTLM Credentials will be used to impersonate a Windows user Kerberos Credentials will be used to impersonate a Windows user using Kerberos CD The username will be used to impersonate a Windows user using Constrained delegation Basic Credentials will be used to perform HTTP Basic authentication Digest Credentials will be used to perform HTTP Digest authentication
Adding Authentication
InfoPath does not automatically configure server-only authentication options for you. However, when creating a UDC file, InfoPath automatically creates an authentication block within the UDC file that is preconfigured to use Office Single Sign-on. In order to use this authentication option, you'll need to uncomment the authentication block within the file and add both the SSO application ID and the CredentialType. Most of the time, you'll want to use the SSO credential to log onto Windows, for which you'll need to specify "NTLM" as the CredentialType. The full list of possible credential types is as follows:
Value
Description
Sql
Credentials will be embedded in a database connection string for authentication against a SQL server.
NTLM
Credentials will be used to impersonate a Windows user
Kerberos
Credentials will be used to impersonate a Windows user using Kerberos
CD
The username will be used to impersonate a Windows user using Constrained delegation
Basic
Credentials will be used to perform HTTP Basic authentication
Digest
Credentials will be used to perform HTTP Digest authentication