ComMethodElement 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
代表一種 COM+ 方法,當 COM+ 元件的介面被公開為 Web 服務時所暴露。 此類別無法獲得繼承。
public ref class ComMethodElement sealed : System::Configuration::ConfigurationElement
public sealed class ComMethodElement : System.Configuration.ConfigurationElement
type ComMethodElement = class
inherit ConfigurationElement
Public NotInheritable Class ComMethodElement
Inherits ConfigurationElement
- 繼承
備註
COM+ 整合配置工具(ComSvcConfig.exe)可用於新增特定方法,顯示在產生的服務合約中。
例如,你可以使用以下指令,將元件 COM 介面IFinances中ItemOrders.Financial三個命名的方法加入產生的服務合約中。
ComSvcConfig.exe /i /application:OnlineStore /contract:ItemOrders.Financial,IFinances.{TransferFunds,AddFunds,RemoveFunds} /hosting:complus
當你也執行 ComSvcConfig.exe 時,它會產生以下服務合約,列出上述方法作為 exposedMethod 元素。
<comContract contractType="{C551FBA9-E3AA-4272-8C2A-84BD8D290AC7}" name="IFinances" namespace="http://contoso.com/services/financial">
<exposedMethod name="TransferFunds"/>
<exposedMethod name="AddFunds"/>
<exposedMethod name="RemoveFunds"/>
</comContract>
在服務初始化時,執行時會嘗試透過反映並僅新增元素清單 exposedMethod 中的方法來產生服務契約。 每個未包含在服務合約中的介面方法都會產生追蹤。
建構函式
| 名稱 | Description |
|---|---|
| ComMethodElement() |
初始化 ComMethodElement 類別的新執行個體。 |
| ComMethodElement(String) |
用指定方法初始化該 ComMethodElement 類別的新實例。 |