InfoPath 2007 in combination with either Microsoft Office SharePoint Server 2007 or Windows SharePoint Services allows you to create web-enabled InfoPath forms - this means that you don't need a full InfoPath client installation to let your users fill in a form.(For more info see InfoPath Forms in Office SharePoint Server 2007). To make a InfoPath 2007 form web-enabled - you simply publish it to a SharePoint forms library. Next you go to the Forms library Settings > Advanced Settings. Change Opening Browser-enabled documents to Display as a web page.
These web-enabled forms do have some limitations however as outlined in this post - Functionality lost in InfoPath 2007 "Web-Enabled" Forms. InfoPath has always been very strong at consuming web services and using data returned from these web services in the forms. If you want to use a web service as a datasource within an web-enabled InfoPath form there are some things you need to do to accomplish this - especially when you use a webservice which does not run within the context of SharePoint. When you access a webservice from an web-enabled InfoPath form, Internet Explorer will consider this as a cross-domain setup. So your InfoPath form may work correctly when opening it from your SharePoint with the full client but will give an error when opening in the web browser - "An error occurred accessing the data source in the browser" when not configured correctly.
So here are the steps that you need to complete to get it to work:
- First make sure that cross domain access is enabled for InfoPath Forms Services - Go to SharePoint Central Admin > Switch to the Application Management tab. Underneath InfoPath Forms Services - Choose Configure InfoPath Forms Services. Check "Allow cross domain access for user templates"
- Use the Data Connection Library to store the connection setttings to the web service. A Data Connection Library (DCL) is a new type of SharePoint document library which provides a place to store, manage and share connection files. For more info about DCLs - check out Excel Services part 10: Data Connection Libraries, or connecting to databases made easy, manageable, and secure . Open your your locally saved InfoPath 2007 form in Design View. Select Tools - Data Connections. Select your web service connection and click the Convert button. For the name enter something like http://servername/DataConnectionLibName/WebService.udcx (Ignore the warning that you get ... this will be fixed in post beta2 builds) Once the connection has been converted to a data connection file, save the form locally again and publish it to the SharePoint forms library.
Voila, and now you can use your webservice as well from an InfoPath form within the browser ... if you have questions, do no hesitate to add it to the comments ...
tags: infopath2007, wss30, sharepoint2007, infopath, microsoft, TechEd-Developers,Moss,Moss2007