Condividi tramite


IParameterInspector Interface

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

Defines the contract implemented by custom parameter inspectors that enables the inspection or modification of information prior to and subsequent to calls on the client.

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

Syntax

'Declaration
Public Interface IParameterInspector
public interface IParameterInspector

The IParameterInspector type exposes the following members.

Methods

  Name Description
Public method AfterCall Called after client calls are returned and before service responses are sent.
Public method BeforeCall Called before client calls are sent and after service responses are returned.

Top

Remarks

Implement the IParameterInspector interface to create a custom parameter inspector that can view and modify the contents of a call both before the call and after the call in client applications.

On outbound calls from a client, the inspector is invoked before the request contents are serialized and sent to the service. The inspector is also called after the response has been deserialized but before the return values have been dispatched to the proxy method.

Use the ClientOperation.ParameterInspectors property to add an IParameterInspector implementation to the inspectors collection for a particular operation.

Developers and administrators must ensure that the interaction with other IParameterInspector implementations is understood.

Examples

The following code example shows an IParameterInspector implementation that:

  • Writes the operation name and return value to the console after a response has been deserialized by the service or a request has been serialized by a client.

  • Writes the operation name to the console after deserializing a response on the client or after a response has been serialized on the service.

The following code example shows how to use either System.ServiceModel.Description.IOperationBehavior or System.ServiceModel.Description.IEndpointBehavior to insert IParameterInspector objects.

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.