OneWayBinding

Link. August 29, 2007. Comments [0]. Posted in: WCF

After writing my last post, I realized that an even better way to do this is to actually formalize the binding as a custom binding:

public class OneWayBinding : CustomBinding
{
   public OneWayBinding(Binding baseBinding) 
      : base(baseBinding)
   {
   }

   public override BindingElementCollection CreateBindingElements()
   {
      BindingElementCollection bec = base.CreateBindingElements();
      bec.Insert(0, new OneWayBindingElement());
      return bec;
   }
}

Then you can simply say:

CustomBinding binding = new OneWayBinding(new NetTcpBinding());


Comments are closed.

About

Tomas Restrepo is a software developer located in Colombia, South America. His interests include .NET, Connected Systems, PowerShell and lately dynamic programming languages. More...

tomasrestrepo @ twitter My Flickr photostream My saved links on delicious My Technorati Profile

email: tomas@winterdom.com
msn: tomasr@passport.com

View my profile on LinkedIn

MVP logo

Syndicate

Ads


Links

Categories

Statistics

Total Posts: 1020
This Year: 90
This Month: 9
This Week: 0
Comments: 791

Blogroll

Post Archive

Other

Copyright © 2002-2008, Tomas Restrepo.

Powered by: newtelligence dasBlog 2.1.8102.813

Sign In