戰地連結︰ Home My Flickr NBA.com About

2008年5月2日星期五

MOSS hosted InfoPath Form with Web Services Data Connection

Overview

在上一篇文 Publish Browser Enabled InfoPath Form to MOSS 2007 中分享了製作 MOSS browser enabled InfoPath Form 的方法. 今次就再為InfoPath Form 加上 Web Services 既 Data Connection.

Reference

  1. InfoPath and Web Service data connection
  2. Data Connections in Browser Forms
  3. Data Connection Libraries
  4. Publish a form template to a server running InfoPath Forms Services
  5. How to: Deploy Form Templates That Contain Form Code
  6. MSDN - Visual Studio 2005 Tools for Applications

Steps

我的經驗告訴我, 所有與 SharePoint 扯上關係的 Development 都不會像表面所看那麼簡單... 一定有很多困難的地方. 這次都不例外, 看看上面列出的 reference link 數目之多就可知道...

在下面我只會例出簡單的流程, 並指出相對應的 reference.

  1. 當然是先要建立起一個web service吧. 這個用 Visual Studio 2005 可以輕鬆做到.
  2. 建立與web service溝通的 InfoPath Form Template. 在 InfoPath 2007 中的 "Design a Form Template" Wizard 可以讓你一步一步建立起以 web service 做為 data source 及 submit target 的 Form Template. 詳細請參考 Reference 1. 下面列出幾點要注意的地方︰
    2.1   在 "Design a Form Template" Wizard 中可以選 "Enable browser-compatible features
            only", 可以避免誤用與 browser 不相容的功能.
    2.2   在 "Tools" => "Form Options" => "Compatibility" 中選 "Design a form template that
            can ......"
    , 再將要 deploy / test 的 MOSS 的 URL 打入. InfoPath 就會用動替你找出
            template中任何與 server 不相容的地方, 並顯示在 "Design Checker" 中看到.
  3. 在 InfoPath 中, 將 Data Connection Convert 並存放在 MOSS 的 Data Connection Library 中, 等候 MOSS Administrator Approve (在 development 的時候, 應該你自己就是 administrator). 詳細請參考 Reference 3. 這步驟很重要, 不然之後在 browser submit form 的時候會出 Security Notice.
  4. 好~ InfoPath 的 Form Template 做完. 跟著就要去 MOSS 做 configuration. 先去 "Central Administration" Page, 再 "Application Management" => "Configure InfoPath Form Services", 然後選 "Allow cross-domain data access .....".
  5. 最後再去之前 Step 3 中 store Data Connection 的 MOSS Data Connection Library, 將所有要用的 Data Connection 都 Approve (當然要用 Administrator account Login). Step 4, 5 都請參考 Reference 2 & Reference 4.
  6. 最後將 Form Template Publish 去 MOSS, new 一張 Form 試一下, 如果沒問題就完成了!

Reference 5, 6 是關於如何在 InfoPath 中寫 custom code, 這將需要 VSTA. 而且 depoly 去 MOSS 的時候也有多些 configure 要做, 就不在這裡多講了.

沒有留言: