Its well known that blackpoint doesnt cater for external data sources using SmartObjects, so the alternative is is to use Web Service methods as custom data connections in the InfoPath Form - sounds easy... Unfortunately, it requires a bit more work if you intend your users to open the InfoPath form in a Web Browser.
If you create a new data connection to a Web Service and use it in your InfoPath Form, you are going to run into problem. More specifically, an error when you try to open a new InfoPath form in InfoPath Client:
The query cannot be run for the following DataObject: SayHelloToUser
InfoPath cannot run the specified query.
Access to the connection file http://moss.k2demo.local/_layouts/GetDataConnectionFile.aspx is denied.
There is a couple of steps that you need to perform to fix this.
1. Design your InfoPath Form template and integrate with the K2 blackpoint process.
2. Add the Web Service data connections to the InfoPath template as per normal and complete the design of the InfoPath form and the blackpoint process to such a point that you are ready to deploy the process.
3. Open the InfoPath Form Template from K2 Studio and go to your data connections for the custom Web Services.
4. Click on 1 of the data connections and click on the Convert... button on the right-hand site
5. In the 1st screen on the conversion wizard, specify the URL of the root SharePoint Site Collection, select the Centrally managed connection library (advanced) option and click Browse and click on K2 BlackPeal Data Connections and then on InfoPath Web Service. Then give your data connection a name and click on Save and then on OK. If you get and error saying that it cant connect to SharePoint - stop the Systen Event Notification Windows service and try again.
6. Repeat steps 4 and 5 for all the other data connections.
7. Now, open an IE browser and navigate to [Root Site Collection URL] > View All Site Content > K2 BlackPearl Data Connections > InfoPath Web Service. Click on the dropdown next to the data connection name and select Sent to > Download a copy. Save the UCDX file somewhere in a temporary forlder. Do the same for all your other data connections.
8. Open Central Admin and navigate to Application Management > InfoPath Form Services > Manage data connection files. Upload all the UCDX files that you downloaded in step 7.
9. Now go back to your InfoPath Form template and REMOVE all your custom data connections.
10. In the Data Connection screen, clic on the Add... button and select the Search for connections on a Microsoft SharePoint Server option and click Next.
11. In the Site dropdown, select your root Site Collection URL (if its empty, add it by clicking on Manage Sites...). In the treeview below, expand K2 BlackPeal Data Connections and click on Next until you can click on Finish.
12. Repeat steps 10 and 11 for the rest of your data connections.
13. Now you can deploy your blackpoint process and your InfoPath Client Events will open in a Web Browser without a problem.
If you have any questions on the above, please drop me a mail on eugenej@k2.com.
[eugenej]