IBindingDeliveryCapabilities Interface

Defines the interface that bindings must implement to describe and advertise the capabilities that clients and services may require.

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public interface class IBindingDeliveryCapabilities

The IBindingDeliveryCapabilities interface must be implemented by a binding if clients and services are to be able to stipulate, as part of their contract, that the features they require are provided by the binding.

The following sample requires that CalculatorService must use a WSHttpBinding with ordered message delivery. Reliable sessions and queued delivery are not used by default with this binding, but can be enabled.

<!-- Here is the configuration for a CalculatorService using a WSHttpBinding with ordered message delivery required. -->
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
   <system.serviceModel>
      <services>
         <service 
             type="Microsoft.ServiceModel.Samples.CalculatorService">
            <!-- Use base address provided by host and a WSHttpBinding named "Binding1" -->
            <endpoint address=""
                      binding="wsHttpBinding"
                      bindingConfiguration="Binding1" 
                      contract="Microsoft.ServiceModel.Samples.ICalculator" />
         </service>
      </services>

      <bindings>
         <wsHttpBinding> 
            <binding name="Binding1">         
               <!-- The next element enables a ReliableSession and required ordered delivery-->
      <reliableSession enabled="true" ordered="true"/>
      </binding>
         </wsHttpBinding>
      </bindings>

   </system.serviceModel>
</configuration>

// The CalculatorService configuration has enabled a reliable session
// with ordered delivery set to true. This means that the binding
// requirement for ordered delivery specified by the
// BindingRequirementsAttribute on the CalculatorService class
// implemented below will be satisfied by this WSHttpBinding.

using System;
using System.ServiceModel;

[ServiceContract]
interface ICalculatorService
{
  [OperationBehavior()]
  int Add(int a, int b);  

  [OperationContract]
  int Subtract(int a, int b);
}

[BindingRequirements(
  QueuedDeliveryRequirements=RequirementsMode.Disallow,
  RequireOrderedDelivery=true
)]
class CalculatorService: ICalculatorService
{
  public int Add(int a, int b)
  {
    Console.WriteLine("Add called.");
    return a + b; 
  }
  
  public int Subtract(int a, int b)
  {
    Console.WriteLine("Subtract called.");
    return a - b;
  }
  
  public int Multiply(int a, int b)
  {
    return a * b;
  }
}

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft