Welcome to Windows Communication Foundation (WCF)
Top Tasks :

MessagePipeline (JuneCTP)

File Details
Downloads: 570 File Size: 24kB
Posted By: Anonymous Views: 1777
Date Added: Tue, Jul 18 2006

The PipelineBehaviorElement class enables to plug-in a pipeline of the filters into the message inspector without knowing any plumbing details. It's similar concept to the WSE Filters. Each Filter can be initiated individually based on the config properties. The following code snippet shows an example of the message pipeline configuration:

<behaviors>
 <serviceBehaviors>
  <behavior name="MessagePipeline">
    <pipeline enable="true">
      <InputFilters>
        <Filter name="inpfilter_1" 
        	type="RKiss.Filters.FilterTester, WCFFilters" 
        	myprop="12345"/>
        <!-- more input filters -->
        <Filter name="inpfilter_N" 
        	type="RKiss.Filters.FilterViewer, WCFFilters" 
        	color="cyan"/>
      </InputFilters> 
      <OutputFilters enable="true">
        <Filter name="outfilter_1" 
        	type="RKiss.Filters.FilterViewer, WCFFilters" 
        	color="white"/>
        <!-- more output filters -->
        <Filter name="outfilter_M" 
        	type="RKiss.Filters.FilterTester, WCFFilters" 
        	myprop2="abcd"/>
      </OutputFilters>
    </pipeline>
  </behavior>
 </serviceBehaviors>
</behaviors>
<extensions>
 <behaviorExtensions>
  <add name="pipeline" type="RKiss.Filters.PipelineBehaviorElement,WCFFilters,
       Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
 </behaviorExtensions>
</extensions>

 

The following code snippet shows an example of the Filter:

public class FilterViewer : FilterBase
{
  public FilterViewer() : base() {}
  public FilterViewer(HybridDictionary properties) : base(properties) {}

  public override bool ProcessMessage(ref Message message)
  {
      using (MessageBuffer buffer = message.CreateBufferedCopy(0xfffff))
      {
          Message msg = buffer.CreateMessage();
          
          // todo:
          
          message = msg;
      }
      return true;
  }
}

Comments
 

Roman Kiss said:

Please, use the following download link: http://www.codeproject.com/soap/WSTransferWorkflow/WCFFilters.zip Thanks Roman
Sun, Jul 15 2007 13:20

Add Comment

Name (required)
Web Site (optional)
Comment (required)
Add

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us