public void ApplyDispatchBehavior(ServiceDescription serviceDescription, System.ServiceModel.ServiceHostBase serviceHostBase) { _Log.Info("Apply Schema Validation DispatchBehavior"); foreach (ChannelDispatcher channelDispatcher in serviceHostBase.ChannelDispatchers) { foreach (EndpointDispatcher endpointDispatcher in channelDispatcher.Endpoints) { _Log.InfoFormat("Adding to {0}", endpointDispatcher.EndpointAddress.Uri); SchemaValidationMessageInspector svmi = new SchemaValidationMessageInspector(schemaSet, validateRequest, validateReply, false); endpointDispatcher.DispatchRuntime.MessageInspectors.Add(svmi); } } }
public void ApplyDispatchBehavior(ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.EndpointDispatcher endpointDispatcher) { SchemaValidationMessageInspector inspector = new SchemaValidationMessageInspector(schemaSet, validateRequest, validateReply, false); endpointDispatcher.DispatchRuntime.MessageInspectors.Add(inspector); }