Export (0) Print
Expand All

IServiceBehavior.AddBindingParameters Method

Provides the ability to pass custom data to binding elements to support the contract implementation.

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

void AddBindingParameters(
	ServiceDescription serviceDescription,
	ServiceHostBase serviceHostBase,
	Collection<ServiceEndpoint> endpoints,
	BindingParameterCollection bindingParameters
)

Parameters

serviceDescription
Type: System.ServiceModel.Description.ServiceDescription

The service description of the service.

serviceHostBase
Type: System.ServiceModel.ServiceHostBase

The host of the service.

endpoints
Type: System.Collections.ObjectModel.Collection<ServiceEndpoint>

The service endpoints.

bindingParameters
Type: System.ServiceModel.Channels.BindingParameterCollection

Custom objects to which binding elements have access.

Use the AddBindingParameters method to add custom data objects to the parameters collection that binding elements can use to acquire extra information to enable them to support the contract.

This method is called once for each listen URI. For example, if a service has four endpoints, and two of them have the same listen URI, then this method gets called three times. The reason is that the bindingParameters target each channel stack and there is one channel stack for each listen URI. Because each call receives those endpoints at that listen URI, two calls each get a single System.ServiceModel.Description.ServiceEndpoint, and one call gets a collection of two System.ServiceModel.Description.ServiceEndpoint objects.

NoteNote

All of the IServiceBehavior methods pass System.ServiceModel.Description.ServiceDescription and System.ServiceModel.ServiceHostBase objects as a parameters. The ServiceDescription parameter is for examination and insertion of customizations only; if you otherwise modify these objects the execution behavior is undefined.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft