C# Class Microsoft.Protocols.TestSuites.Common.MessageInspector

This class which implements the IEndpointBehavior and IClientMessageInspector interface is used to add MS-WOPI request header and store all the requests and responses for both MS-FSSHTTP and MS-WOPI.
Inheritance: IEndpointBehavior, IClientMessageInspector
Show file Open project: OfficeDev/Interop-TestSuites

Public Methods

Method Description
AddBindingParameters ( ServiceEndpoint endpoint, System bindingParameters ) : void

Implement the IEndpointBehavior interface to pass data at runtime to bindings to support custom behavior. In this implementation, this function will be kept empty.

AfterReceiveReply ( System &reply, object correlationState ) : void

Implementation does schema validation for the MS-FSSHTTP defined element after a reply message is received.

ApplyClientBehavior ( ServiceEndpoint endpoint, ClientRuntime clientRuntime ) : void

Implements a modification or extension of the client across an endpoint. In this implementation, this function will add a custom inspector to the client endpoint to add the MS-WOPI headers and do the schema validation.

ApplyDispatchBehavior ( ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher ) : void

Implements a modification or extension of the service across an endpoint. In this implementation, this function will be kept empty.

BeforeSendRequest ( System &request, System channel ) : object

Implementation will add the headers for MS-WOPI before a request message is sent to a service.

MessageInspector ( SharedContext context ) : System.IO

Initializes a new instance of the MessageInspector class with the specified context.

Validate ( ServiceEndpoint endpoint ) : void

Implement to confirm that the endpoint meets some intended criteria. In this implementation, this function will be kept empty.

Private Methods

Method Description
AddHeader ( System &request, string headerKey, string value ) : void

This method is used to add headers to the MS-WOPI requests.

SizeOfWOPIMessage ( Message message ) : int

This method is used to calculate the message size.

Method Details

AddBindingParameters() public method

Implement the IEndpointBehavior interface to pass data at runtime to bindings to support custom behavior. In this implementation, this function will be kept empty.
public AddBindingParameters ( ServiceEndpoint endpoint, System bindingParameters ) : void
endpoint System.ServiceModel.Description.ServiceEndpoint The endpoint to modify
bindingParameters System The objects that binding elements require to support the behavior.
return void

AfterReceiveReply() public method

Implementation does schema validation for the MS-FSSHTTP defined element after a reply message is received.
public AfterReceiveReply ( System &reply, object correlationState ) : void
reply System Specify the message to be transformed into types and handed back to the client application.
correlationState object Specify the correlation state data.
return void

ApplyClientBehavior() public method

Implements a modification or extension of the client across an endpoint. In this implementation, this function will add a custom inspector to the client endpoint to add the MS-WOPI headers and do the schema validation.
public ApplyClientBehavior ( ServiceEndpoint endpoint, ClientRuntime clientRuntime ) : void
endpoint System.ServiceModel.Description.ServiceEndpoint The endpoint that is to be customized.
clientRuntime System.ServiceModel.Dispatcher.ClientRuntime The client runtime to be customized.
return void

ApplyDispatchBehavior() public method

Implements a modification or extension of the service across an endpoint. In this implementation, this function will be kept empty.
public ApplyDispatchBehavior ( ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher ) : void
endpoint System.ServiceModel.Description.ServiceEndpoint The endpoint that exposes the contract.
endpointDispatcher System.ServiceModel.Dispatcher.EndpointDispatcher The endpoint dispatcher to be modified or extended.
return void

BeforeSendRequest() public method

Implementation will add the headers for MS-WOPI before a request message is sent to a service.
public BeforeSendRequest ( System &request, System channel ) : object
request System Specify the message to be sent to the service.
channel System Specify the client object channel.
return object

MessageInspector() public method

Initializes a new instance of the MessageInspector class with the specified context.
public MessageInspector ( SharedContext context ) : System.IO
context SharedContext Specify the context which will give information for MS-WOPI headers.
return System.IO

Validate() public method

Implement to confirm that the endpoint meets some intended criteria. In this implementation, this function will be kept empty.
public Validate ( ServiceEndpoint endpoint ) : void
endpoint System.ServiceModel.Description.ServiceEndpoint The endpoint to validate.
return void