Bewerken

Delen via


IMessageFilterTable<TFilterData>.GetMatchingValue Method

Definition

Returns a value that indicates whether the match criterion of a filter in the table is satisfied by the specified message or buffered message, and returns the filter data for the filter that matched.

Overloads

GetMatchingValue(Message, TFilterData)

Returns a value that indicates whether the match criterion of exactly one filter in the table is satisfied by the specified message, and adds the matching filter data to a collection.

GetMatchingValue(MessageBuffer, TFilterData)

Returns a value that indicates whether the match criterion of exactly one filter in the table is satisfied by the specified buffered message, and adds the matching filter data to a collection.

Remarks

Use one of these methods when, at most, one filter is expected to match the message and only the filter data from the matching filter must be recovered. These methods return a boolean that indicates whether a matching filter was found and set the data reference parameter to the matching filter data.

Use GetMatchingFilter if the body of the message is not inspected by any of the filters in the filter table.

If the body of the message may be inspected by a filter in the filter table, buffer the message and pass it to the GetMatchingFilter version of the method.

GetMatchingValue(Message, TFilterData)

Source:
IMessageFilterTable.cs
Source:
IMessageFilterTable.cs

Returns a value that indicates whether the match criterion of exactly one filter in the table is satisfied by the specified message, and adds the matching filter data to a collection.

public:
 bool GetMatchingValue(System::ServiceModel::Channels::Message ^ message, [Runtime::InteropServices::Out] TFilterData % value);
public bool GetMatchingValue (System.ServiceModel.Channels.Message message, out TFilterData value);
abstract member GetMatchingValue : System.ServiceModel.Channels.Message * 'FilterData -> bool
Public Function GetMatchingValue (message As Message, ByRef value As TFilterData) As Boolean

Parameters

message
Message

The Message to test.

value
TFilterData

out parameter that stores the FilterData that matches the message.

Returns

true if the match criterion of exactly one filter in the table is satisfied by the message; false if no filter is satisfied.

Remarks

Use this method when a single filter is expected to match the message and only the filter data from the matching filter must be recovered.

This method expects at most a single matching filter. If more than one filter matches, a MultipleFilterMatchesException must be thrown.

If the body of the message must be inspected by a filter in the filter table, buffer the message using CreateBufferedCopy and pass it to the GetMatchingValue version of the method.

Notes to Implementers

If more than one filter matches the message, a MultipleFilterMatchesException must be thrown.

This overload takes a Message and must throw an InvalidBodyAccessException if it tries to examine the message body.

Applies to

GetMatchingValue(MessageBuffer, TFilterData)

Source:
IMessageFilterTable.cs
Source:
IMessageFilterTable.cs

Returns a value that indicates whether the match criterion of exactly one filter in the table is satisfied by the specified buffered message, and adds the matching filter data to a collection.

public:
 bool GetMatchingValue(System::ServiceModel::Channels::MessageBuffer ^ messageBuffer, [Runtime::InteropServices::Out] TFilterData % value);
public bool GetMatchingValue (System.ServiceModel.Channels.MessageBuffer messageBuffer, out TFilterData value);
abstract member GetMatchingValue : System.ServiceModel.Channels.MessageBuffer * 'FilterData -> bool
Public Function GetMatchingValue (messageBuffer As MessageBuffer, ByRef value As TFilterData) As Boolean

Parameters

messageBuffer
MessageBuffer

The MessageBuffer to test.

value
TFilterData

out parameter that stores the FilterData that matches the messageBuffer.

Returns

true if the match criterion of exactly one filter in the table is satisfied by the message; false if no filter is satisfied.

Remarks

Use this method when a single filter is expected to match the buffered message, only the filter data from the matching filter must be recovered, and the body of the message may have to be inspected.

Notes to Implementers

If more than one filter matches the message, a MultipleFilterMatchesException must be thrown.

Applies to