Поделиться через


IEndpointBehavior Interface

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Implements methods that can be used to extend run-time behavior for an endpoint in a Silverlight application.

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

Syntax

'Declaration
Public Interface IEndpointBehavior
public interface IEndpointBehavior

The IEndpointBehavior type exposes the following members.

Methods

  Name Description
Public method AddBindingParameters Implement to pass data at runtime to bindings to support custom behavior.
Public method ApplyClientBehavior Implements a modification or extension of the client across an endpoint.
Public method ApplyDispatchBehavior This method does not get invoked in Silverlight.
Public method Validate Implement to confirm that the endpoint meets some intended criteria.

Top

Remarks

Implement the IEndpointBehavior interface to modify, examine, or extend some aspect of endpoint-wide execution at the application level for Silverlight applications.

  • Use the AddBindingParameters method to pass custom data at runtime to enable bindings to support custom behavior.

  • Use the ApplyClientBehavior method to modify, examine, or insert extensions to an endpoint in a client application.

  • The ApplyDispatchBehavior does not get used in the current version of Silverlight.

  • Use the Validate method to confirm that a ServiceEndpoint meets specific requirements. This can be used to ensure that an endpoint has a certain configuration setting enabled, supports a particular feature and other requirements.

IEndpointBehavior objects can make use of any of these methods, but often only one is important; in such cases, the unused methods can return, performing no action.

NoteNote:

All of the IEndpointBehavior methods pass a ServiceEndpoint object as a parameter. This parameter is for examination only; if you modify the ServiceEndpoint object the execution behavior is undefined.

IEndpointBehavior objects are typically used to access the various properties of the System.ServiceModel.Dispatcher.DispatchRuntime, System.ServiceModel.Dispatcher.DispatchOperation, and System.ServiceModel.Dispatcher.EndpointDispatcher objects in a service application and the System.ServiceModel.Dispatcher.ClientRuntime and System.ServiceModel.Dispatcher.ClientOperation in a client application.

Once a customization has been decided upon (and the customization interface implemented if necessary) and the IEndpointBehavior has been decided is the appropriate scope of customization, the customization must be inserted into the Silverlight runtime by implementing IEndpointBehavior and adding the endpoint behavior to the runtime.

To perform the service customization task for which it is intended, the IEndpointBehavior object must be added to the ServiceEndpoint.Behaviors property prior to the construction of the service runtime, which occurs when ICommunicationObject.Open method is called on System.ServiceModel.ServiceHost. To perform a client customization task, the IEndpointBehavior object must be added to the ServiceEndpoint.Behaviors property before calling the ChannelFactory<TChannel>.CreateChannel method or the ICommunicationObject.Open method on ChannelFactory<TChannel>.

Version Information

Silverlight

Supported in: 5, 4

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.