共用方式為


使用 IntelliSense 建立攔截器組態檔

您可以在 Visual Studio 中使用 IntelliSense 和架構驗證,以協助您建構圖解有效的攔截器組態檔。 BAM 管理公用程式會對照基本攔截器組態結構描述驗證您的攔截器組態檔,而且如果檔案無效,則不會部署結構描述。 如果檔案針對基底攔截器組態架構通過驗證,則會根據 Windows Workflow Foundation (WF) 架構或 Windows Communication Foundation (WCF) 架構在執行時間進行驗證,如果發生錯誤,則不會發生攔截。 建構攔截器組態檔時,您可以在 Visual Studio 中使用架構驗證來避免這些錯誤。

注意

範例 BAM 攔截器組態 XSD 檔會隨 SDK 檔一併安裝。 您可以在 \Program Files (x86) \Microsoft BizTalk Server < VERSION > SDK\Samples\BAM\InterceptorXSDs 找到:

  • CommonInterceptorConfiguration.xsd
    • WcfInterceptorConfiguration.xsd
    • WorkflowInterceptorConfiguration.xsd

取得攔截器結構描述的副本

  1. 開啟「記事本」或其他文字編輯器。

  2. 流覽至 攔截器組態架構 主題。

  3. 將內容貼到開啟文字編輯器中的新檔中,然後使用 CommonInterceptorConfiguration.xsd (名稱儲存檔案,或您自己選擇) 硬碟的其中一個文字檔。

  4. 針對 Windows Workflow Foundation (WF) 架構和 Windows Communication Foundation (WCF) 架構主題,使用 檔案名 WorkflowInterceptorConfiguration.xsdWcfInterceptorConfiguration.xsd 或您選擇的名稱重複這些步驟。

搭配攔截器組態檔使用 IntelliSense

  1. 開啟 Visual Studio。

  2. 依序按一下 [ 檔案]、[ 新增] 和 [ 檔案]。

  3. 在 [ 新增檔案 ] 對話方塊中,選取 [XML 檔案] ,然後按一下 [ 開啟]。

  4. 以滑鼠右鍵按一下編輯窗格,然後按一下 [屬性],以檢視 [ 屬性] 窗格。

  5. 在 [屬性] 窗格中,按一下 [ 架構],然後按一下省略號 (...) 。

  6. 在 [XML 架構]對話方塊中,按一下 [新增],然後流覽至架構的位置,然後在您使用 Windows Workflow) (Foundation (WF) 攔截器組態檔時,選取[CommonInterceptorConfiguration.xsd] 和 [WcfInterceptorConfiguration.xsd]。

    注意

    如果您使用不同的名稱儲存檔案,則選取這些檔案。

  7. Visual Studio 現在會在開啟攔截器組態檔時驗證您的攔截器組態檔,並在您建立和修改檔案時提供 IntelliSense 說明。

另請參閱

Windows Workflow Foundation 結構描述
Windows Communication Foundation 結構描述