Επεξεργασία

Κοινή χρήση μέσω


ActionMessageFilter.Match Method

Definition

Tests whether a message or a buffered message matches one of the actions configured for the filter.

Overloads

Match(Message)

Tests whether a message's action matches one of the actions specified in this ActionMessageFilter.

Match(MessageBuffer)

Tests whether a buffered message's action header matches one of the actions specified in this ActionMessageFilter.

Remarks

The difference between the two overloads is that one takes a Message parameter and cannot examine the message body; the other takes a MessageBuffer parameter and can examine any part of the message. Because an action filter does not examine the body, these methods are equivalent.

If you must check the message against multiple ActionMessageFilter objects, put the filters into an IMessageFilterTable<TFilterData> and then use the matching functionality provided by the table.

Match(Message)

Tests whether a message's action matches one of the actions specified in this ActionMessageFilter.

public:
 override bool Match(System::ServiceModel::Channels::Message ^ message);
public override bool Match (System.ServiceModel.Channels.Message message);
override this.Match : System.ServiceModel.Channels.Message -> bool
Public Overrides Function Match (message As Message) As Boolean

Parameters

message
Message

The Message to test.

Returns

true if the Message action header matches one of the specified actions; otherwise, false.

Exceptions

message is null.

Remarks

Use this overload of Match when a message must be tested against the actions in a single filter and the Message is available.

Applies to

Match(MessageBuffer)

Tests whether a buffered message's action header matches one of the actions specified in this ActionMessageFilter.

public:
 override bool Match(System::ServiceModel::Channels::MessageBuffer ^ messageBuffer);
public override bool Match (System.ServiceModel.Channels.MessageBuffer messageBuffer);
override this.Match : System.ServiceModel.Channels.MessageBuffer -> bool
Public Overrides Function Match (messageBuffer As MessageBuffer) As Boolean

Parameters

messageBuffer
MessageBuffer

The MessageBuffer to test.

Returns

true if the MessageBuffer action header matches one of the specified actions; otherwise, false.

Exceptions

messageBuffer is null.

Remarks

Use this overload of the Match method when a message must be tested against the actions in a single filter and the MessageBuffer is available.

Applies to