<channelSinkProviders> 元素

包含客户端和服务器信道接收器提供程序的模板。在可能注册信道接收器提供程序的任何地方都可以引用此元素下指定的任何信道接收器提供程序。

<configuration>

  <system.runtime.remoting> 元素

    <channelSinkProviders> 元素

<channelSinkProviders> 
      <serverProviders> 
      <clientProviders> 
</<channelSinkProviders>

属性和元素

以下几节介绍属性、子元素和父元素。

属性

无。

子元素

元素 说明

<serverProviders>

包含可插入到服务器信道调用链中的信道接收器模板。可在 <channelSinkProviders> 元素中出现一次。

<clientProviders>

包含可插入到客户端信道调用链中的信道接收器模板。可在 <channelSinkProviders> 元素中出现一次。

父元素

元素 说明

configuration

公共语言运行库和 .NET Framework 应用程序所使用的每个配置文件中的根元素。

system.runtime.remoting

包含有关远程对象和信道的信息。

示例

下面的配置文件使用 <provider> 实例元素向 HttpChannel 分配“propsetter”和“null”信道接收器提供程序,这些提供程序都是用 <provider> 模板元素声明的。另外,还创建了“propsetter”信道接收器提供程序,并将自定义提供程序属性 (Property) 指定为提供程序实例元素的属性 (Attribute) 和子 <endpoint> 属性 (Attribute) 名/值对。

<configuration>
   <system.runtime.remoting>
      <application>
         <client>
            <wellknown 
               type="RemoteType, RemoteAssembly"
               url="http://computername:8080/RemoteType.rem"/>
         </client>
         <channels>
            <channel ref="http">
               <clientProviders>
                  <formatter ref="soap"/>
                  <provider 
                     ref="propsetter" 
                     username="bob" 
                     writeToConsole="true"
                  >
                     <endpoint url="contoso.com:9000" someProperty="xyz" />
                     <endpoint url="contoso.com:9001" someProperty="123" />
                  </provider>
                  <provider ref="null" writeToConsole="true" />
               </clientProviders>
            </channel>
         </channels>
      </application>
      <channelSinkProviders>
         <clientProviders>
            <provider 
               id="propsetter" 
               type="ChannelSinkPropertySetterProvider, SinkAssembly" 
            />
            <provider 
               id="null" 
               type="NullSinkProvider, SinkAssembly" 
            />
         </clientProviders>
      </channelSinkProviders>
      <debug loadTypes="true" />
   </system.runtime.remoting>
</configuration>

请参见

参考

远程处理设置架构

概念

接收器和接收器链

Footer image

版权所有 (C) 2007 Microsoft Corporation。保留所有权利。