- The data that is returned by the Web service is incorrect.
- You receive the following error message:An error occurred accessing a data source.
An entry has been added to the Windows event log of the server.
- The Web service uses the identity of the user who fills out the form.
- The InfoPath 2010 form template contains sandboxed code and is published to a Microsoft SharePoint Server 2010 Web site.
Note InfoPath form code runs by using SharePoint Foundation Sandboxed Code Service if the Administrator-approved form template (advanced) option is not enabled when the form is published.
Note InfoPath Forms Services tries to execute a request in the W3WP process when InfoPath Forms Services determines that no sandboxed code has to be run for a given request. However, if there are cascading actions that may cause sandboxed code to be executed, the request is delegated to SharePoint Foundation Sandboxed Code Service and to the SPUCWorkerProcess process.
Redeploy the sandboxed form as an administrator-approved form. To do this, follow these steps:
- Open the InfoPath 2010 form in Design mode in InfoPath Designer 2010.
- On the File menu, click Publish.
- Click SharePoint Server.
- Follow the instructions in the Publishing Wizard to finish the publication. Make sure that you select the Administrator-approved form template (advanced) option.
- Open SharePoint 2010 Central Administrator on a SharePoint Server 2010 server that has InfoPath Forms Services enabled.
- Under Central Administration, click General Application Settings.
- Under InfoPath Forms Services, click Upload form template.
- Click Browse, locate the InfoPath 2010 form template, and then click Open.
- Click Upload, and then click OK.
- Click General Application Settings, under InfoPath Forms Services, click Manage form templates.
- Click the name of the template that you uploaded, and then click Activate to a Site Collection.
- Click the Site Collection drop-down list, and then click Change Site Collection.
- Select the URL of the site collection where you want to activate the form template, and then click OK two times.
- Open the site collection where you activated the form template.
- Create a new form library on the site.
- On the Library tab, click Library Settings.
- Under the General Settings section, click Advanced settings.
- Set Allow management of content types to Yes, and then click OK.
- In the Form Library Setting page, click Add from existing site content types.
- Click the form template that you activated, click Add, and then click OK.
- Click Form, click Delete this content type, and then click OK.
- Open the form library. On the Documents tab, click New Document, and then click the form template name.
Use the Secure Store Service in SharePoint Server 2010 to store alternate credentials for the data connection.
Secure Store Service authentication works by storing a username and a password in an encrypted database. When InfoPath Forms Services requests Secure Store Service authentications on behalf of a user, Secure Store Service performs individual authentication or group authentication. For individual authentication, Secure Store Service verifies that the requested user has an entry in the Secure Store Service database. For group authentication, Secure Store Service verifies that the user is a member of a group entry. When the user is validated, Secure Store Service returns the appropriate credentials. Then, InfoPath Forms Services uses those credentials to impersonate the user. Therefore, the Web service sees that the user is specified in the Secure Store Service database even if the specified user is not the actual user.
Note The following steps assume that the data connection in the form template uses a UDCX file in a data connection library. For more information about how to create and to use a data connection library in Microsoft Office SharePoint Server 2007, visit the following Microsoft Developer Network (MSDN) Web site:
- Create a new Secure Store Service target application, and then add the account information. To do this, follow these steps:
- Open SharePoint 2010 Central Administrator.
- Click Application Management, and then click Manage service applications.
- Click Secure Store Service.
- Click New. Follow the instructions on the Create New Secure Store Target Application page to configure the target application settings. Note the string that you enter into the Target Application ID box.
Note Make sure that a new key is generated before you create a new Secure Store Service target application.
- Point to the name of target application that you just created, and then select Set Credentials from the drop-down list.
- Enter the account information for the Secure Store Service target application, and then click OK.
- Use the Secure Store Service target application in data connections. To do this, follow these steps:
- Download a copy of the UDCX file that is specified for the data connection.
- Use Notepad to open the UDCX file.
- Locate the <udc:Authentication> section, and then replace it with the following:
<udc:SSO AppId='TestSSOGroup' CredentialType='NTLM'/>
- Change the value of the AppId attribute to the Target Application ID string that you noted previously.
- Save the file in Notepad.
- Upload the updated UDCX file to the SharePoint data connections library. Then, approve the file.
- Restart the SharePoint Server 2010 server.
- Open the InfoPath 2010 sandboxed form in a Web browser.
States the credentials in the UDC file explicitly. To do this, replace the <udc:Authentication> section in the UDCX file by using the following code: