IEndpointBehavior.Validate(ServiceEndpoint) 方法

定义

实现此方法可以确认终结点是否满足某些设定条件。Implement to confirm that the endpoint meets some intended criteria.

public:
 void Validate(System::ServiceModel::Description::ServiceEndpoint ^ endpoint);
public void Validate (System.ServiceModel.Description.ServiceEndpoint endpoint);
abstract member Validate : System.ServiceModel.Description.ServiceEndpoint -> unit
Public Sub Validate (endpoint As ServiceEndpoint)

参数

endpoint
ServiceEndpoint

要验证的终结点。The endpoint to validate.

注解

实现 Validate 方法可以检查结构,从而可以确认所有条件集。Implement the Validate method to examine the structure to confirm any set of criteria. 要使用此方法,并不一定要在 ApplyClientBehaviorApplyDispatchBehavior 中执行自定义。It is not necessary to perform any customizations in ApplyClientBehavior or ApplyDispatchBehavior to make use of this method. 如果终结点通过验证,则返回;否则,引发异常。If the endpoint passes validation, return; otherwise, throw an exception.

例如,可以使用 Validate 方法以确保所有终结点都使用一个已批准的合作绑定。For example, the Validate method can be use to ensure that all endpoints use an approved corporate binding.

适用于