ClientRuntime.MessageInspectors Property
.NET Framework 3.0
Gets a collection of message inspector implementations for a client.
Namespace: System.ServiceModel.Dispatcher
Assembly: System.ServiceModel (in system.servicemodel.dll)
Assembly: System.ServiceModel (in system.servicemodel.dll)
'Declaration Public ReadOnly Property MessageInspectors As SynchronizedCollection(Of IClientMessageInspector) 'Usage Dim instance As ClientRuntime Dim value As SynchronizedCollection(Of IClientMessageInspector) value = instance.MessageInspectors
/** @property */ public SynchronizedCollection<IClientMessageInspector> get_MessageInspectors ()
public function get MessageInspectors () : SynchronizedCollection<IClientMessageInspector>
Not applicable.
Property Value
A collection of IClientMessageInspector implementations.In the following code example an System.ServiceModel.Description.IEndpointBehavior inserts a System.ServiceModel.Dispatcher.IClientMessageInspector into the client runtime by adding it to the MessageInspectors property.
#region IEndpointBehavior Members public void AddBindingParameters( ServiceEndpoint endpoint, BindingParameterCollection bindingParameters ) { return; } public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime) { clientRuntime.MessageInspectors.Add(new Inspector()); foreach (ClientOperation op in clientRuntime.Operations) op.ParameterInspectors.Add(new Inspector()); } public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher) { endpointDispatcher.DispatchRuntime.MessageInspectors.Add(new Inspector()); foreach (DispatchOperation op in endpointDispatcher.DispatchRuntime.Operations) op.ParameterInspectors.Add(new Inspector()); } public void Validate(ServiceEndpoint endpoint){ return; }
The following code example shows a configuration file that loads the endpoint behavior into the client endpoint.
<client> <endpoint address="http://localhost:8080/SampleService" behaviorConfiguration="clientInspectorsAdded" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISampleService" contract="ISampleService" name="WSHttpBinding_ISampleService" > </endpoint> </client> <behaviors> <endpointBehaviors> <behavior name="clientInspectorsAdded"> <clientInterceptors /> </behavior> </endpointBehaviors> </behaviors> <extensions> <behaviorExtensions> <add name="clientInterceptors" type="Microsoft.WCF.Documentation.InspectorInserter, HostApplication, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" /> </behaviorExtensions> </extensions>
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: