XPathMessageFilter.Match XPathMessageFilter.Match XPathMessageFilter.Match XPathMessageFilter.Match Method

Definition

Determines whether a message or XML document satisfies the query criteria of the XPath filter.

Overloads

Match(Message) Match(Message) Match(Message)

Tests whether a specified message satisfies the criteria of the XPath filter. This form is not allowed to access the body of the message.

Match(MessageBuffer) Match(MessageBuffer) Match(MessageBuffer)

Determines whether a buffered message satisfies the query criteria of the XPath filter.

Match(SeekableXPathNavigator) Match(SeekableXPathNavigator) Match(SeekableXPathNavigator) Match(SeekableXPathNavigator)

Determines whether the XML document provided by the specified optimized XPath navigator satisfies the query criteria of the XPath filter.

Match(XPathNavigator) Match(XPathNavigator) Match(XPathNavigator) Match(XPathNavigator)

Evaluates the filter over the specified XPath navigator.

Remarks

These methods check one filter against a message. If you need to check the message against multiple filters, put the filters into a filter table and then use the match methods provided by the table.

If you only need to test the message headers and not the message body, use the Match method.

If you need to test parts of the message body, use the Match method.

For tests that involve XPath queries, use one of the remaining overloads of the Match.

Match(Message) Match(Message) Match(Message)

Tests whether a specified message satisfies the criteria of the XPath filter. This form is not allowed to access the body of the message.

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

Parameters

message
Message Message Message Message

The Message to test.

Returns

true if the Message satisfies the filter criteria; otherwise, false.

Exceptions

The XPath evaluation attempted to examine the body of the message.

Remarks

Use the XPathMessageFilter.Match method to match elements from the body. An exception is thrown by this method if the engine attempts to access the message body in order to evaluate the XPath expression. This helps to ensure that the filter engine does not access the body stream.

Match(MessageBuffer) Match(MessageBuffer) Match(MessageBuffer)

Determines whether a buffered message satisfies the query criteria of the XPath filter.

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

Parameters

Returns

true if the Match(MessageBuffer) satisfies the filter criteria; otherwise false.

Exceptions

Remarks

Use this overload of the Match method when a MessageBuffer is available. This form is allowed to examine the body of the message.

Match(SeekableXPathNavigator) Match(SeekableXPathNavigator) Match(SeekableXPathNavigator) Match(SeekableXPathNavigator)

Determines whether the XML document provided by the specified optimized XPath navigator satisfies the query criteria of the XPath filter.

public:
 bool Match(System::ServiceModel::Dispatcher::SeekableXPathNavigator ^ navigator);
public bool Match (System.ServiceModel.Dispatcher.SeekableXPathNavigator navigator);
override this.Match : System.ServiceModel.Dispatcher.SeekableXPathNavigator -> bool
Public Function Match (navigator As SeekableXPathNavigator) As Boolean

Parameters

Returns

true if the data from the SeekableXPathNavigator satisfies the filter criteria; otherwise, false.

Exceptions

Remarks

The SeekableXPathNavigator class extends the XPathNavigator class with methods that run queries more efficiently.

Match(XPathNavigator) Match(XPathNavigator) Match(XPathNavigator) Match(XPathNavigator)

Evaluates the filter over the specified XPath navigator.

public:
 bool Match(System::Xml::XPath::XPathNavigator ^ navigator);
public bool Match (System.Xml.XPath.XPathNavigator navigator);
override this.Match : System.Xml.XPath.XPathNavigator -> bool
Public Function Match (navigator As XPathNavigator) As Boolean

Parameters

navigator
XPathNavigator XPathNavigator XPathNavigator XPathNavigator

The XPathNavigator that provides data to test.

Returns

true if the data from the XPathNavigator satisfies the filter criteria; false otherwise.

Exceptions

Applies to