Share via


<channelSinkProviders> 元素

本主题介绍一项传统技术,保留该技术是为了向后兼容现有的应用程序,不建议对新的开发使用该技术。现在应该使用  Windows Communication Foundation (WCF) 来开发分布式应用程序。

包含客户端和服务器信道接收器提供程序的模板。在可能注册信道接收器提供程序的任何地方都可以引用此元素下指定的任何信道接收器提供程序。此元素可能出现在应用程序配置文件和计算机配置文件中。

Schema Hierarchy

<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”信道接收器提供程序,并将自定义提供程序属性指定为提供程序实例元素的特性和子 <endpoint> 特性名/值对。

<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>

另请参见

参考

远程处理设置架构

概念

接收器和接收器链

生成日期:2010-02-13