Some time ago I needed to turn on anonymous access to InfoPath forms in Sharepoint. There were several requirements for the forms:
- forms should be browser-enabled after provisioning
- forms are provisioned in custom document library not in root site
- forms should be available for anonymous users after provisioning
First problem was to make InfoPath form which located in custom doclib (i.e. doclib which created using custom ListTemplate.xml and custom Schema.xml) browser-enabled. In order to do this several steps should be performed:
- Configure .xsn form to turn on browser compatibility. In InfoPath application open menu “Tools –> Form options –> Compatibility” and check “Design a form template that can be opened in a browser or InfoPath”
- Configure doclib. Open and doclibe “Settings –> Advanced Settings” and check “Display as a Web page”. If you want to specify it during provisioning to need to add DefaultItemOpen=”1” attribute in <List> tag in Schema.xml:
- The most interesting step. After form was provisioned into custom doclib:
it was not browser-enabled despite of the fact that previous 2 steps were done. I made investigation of this problem and found that in order to make InfoPath form browser-enabled after provisioning you need to re-publish this form manually using InfoPath application into the same doclib using the same form name (same URL).
I found several ways to reach the result without manual publishing:
- provision InfoPath form into special FormServerTemplates doclib on root site (it is important moment that this doclib is located on root site). This approach is described in the following post: http://blah.winsmarts.com/2008-8-Deploying_InfoPath_2007_Forms_to_Forms_Server_-and-ndash_Properly.aspx
- use approach with upload + activate forms via Central Administration
Both approaches were not suitable for us because one of the requirements was that forms should be provisioned into custom doclib on non-root site. So we decided to use approach with manual republishing of InfoPath form after provisioning.
Second problem was to configure anonymous access to InfoPath forms. First of all you need to make usual steps when you want to turn on anonymous access to doclib or list (e.g. http://nickgrattan.wordpress.com/2007/07/18/anonymous-access-in-sharepoint-2007/). However it is not enough to allow anonymous users to submit form to server. I tried many approaches but only one of them really worked: approach when all data connections in InfoPath form are configured via anonymous enabled web service (see http://sheetal-d.spaces.live.com/blog/cns!237C3DEA7120098B!632.entry). Author of this post says that he verified this information from SharePoint team also.