title: Service behavior not being applied correctly
body: <p>I have a custom behavior for a service where I want to specify a receive timeout value, I have created a behavior and on the build service header.</p>
  
  <p>I use the declarative attribute to apply the behavior or as I thought. But the behavior seems to make no difference, i.e. the set timeout value is not being applied as expected.</p>
  
  <p>The same behavior when applied explicitly through does work.
  Any ideas?</p>
  
  <p>Behavior:</p>
  
  <pre><code>[AttributeUsage(AttributeTargets.Class)]
  public class BuildServiceBindingBehavior : Attribute, IServiceBehavior
  {
      public BuildServiceBindingBehavior( string p_receiveTime )
      {
          ReceiveTimeout = TimeSpan.Parse( p_receiveTime );
      }
  
      #region IServiceBehavior Members
  
      public void AddBindingParameters( ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, System.Collections.ObjectModel.Collection&lt;ServiceEndpoint&gt; endpoints, System.ServiceModel.Channels.BindingParameterCollection bindingParameters )
      {
      }
  
      public void ApplyDispatchBehavior( ServiceDescription serviceDescription, ServiceHostBase serviceHostBase )
      {
          // add this behavior to each endpoint
          foreach ( var endPoint in serviceDescription.Endpoints )
          {
              endPoint.Binding.ReceiveTimeout = ReceiveTimeout;
          }
      }
  
      public void Validate( ServiceDescription serviceDescription, ServiceHostBase serviceHostBase )
      {
      }
  
      #endregion
  
      internal TimeSpan ReceiveTimeout { get; set; }
  }
  </code></pre>
  
  <p>Service code:</p>
  
  <pre><code>[ServiceBehavior(Name = "DotNetBuildsService",
                   InstanceContextMode = InstanceContextMode.PerSession,
                   ConcurrencyMode = ConcurrencyMode.Single
                   )]
  // Set receieve time out
  [BuildServiceBindingBehavior( "0:0:1" )]
  public class BuildService : IBuildTasksService
  {
    //implementation code
  }
  </code></pre>