語言

XPathMessageFilter.Match 方法

定義

判斷訊息或 XML 文件是否符合 XPath 篩選器的查詢條件。

多載

名稱 Description
Match(Message)

測試指定訊息是否符合 XPath 過濾器的標準。 此表單不允許存取訊息正文。

Match(MessageBuffer)

判斷緩衝訊息是否符合 XPath 濾波器的查詢條件。

Match(SeekableXPathNavigator)

判斷由指定優化 XPath 導航器所提供的 XML 文件是否符合 XPath 篩選器的查詢條件。

Match(XPathNavigator)

評估該篩選器對指定 XPath 導航器的使用。

備註

這些方法會用一個過濾器與訊息進行檢查。 如果你需要用多個過濾器來檢查訊息,可以把這些過濾器放進過濾表,然後使用表格提供的匹配方法。

如果你只需要測試訊息標頭而不需要訊息主體,就用這個 Match 方法。

如果你需要測試訊息內容的部分,就用這個 Match 方法。

對於涉及 XPath 查詢的測試,請使用 .Match

Match(Message)

測試指定訊息是否符合 XPath 過濾器的標準。 此表單不允許存取訊息正文。

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

參數

message
Message

Message要測試。

傳回

true若 滿足Message過濾條件;否則 。 false

例外狀況

message 是 null。

XPath 評估嘗試檢視訊息內容。

編譯器出錯了。

備註

用這個 XPathMessageFilter.Match 方法來匹配身體的元素。 若引擎嘗試存取訊息主體以評估 XPath 表達式,則會拋出例外。 這有助於確保濾清引擎不會接觸到車體氣流。

適用於

Match(MessageBuffer)

判斷緩衝訊息是否符合 XPath 濾波器的查詢條件。

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

參數

messageBuffer
MessageBuffer

MessageBuffer要測試。

傳回

true 若 滿足 Match(MessageBuffer) 過濾條件;否則 false。

例外狀況

message 是 null。

編譯器出錯了。

備註

當 a Match 可用時,利用這個方法的MessageBuffer過載。 此表單允許檢視訊息正文。

適用於

Match(SeekableXPathNavigator)

判斷由指定優化 XPath 導航器所提供的 XML 文件是否符合 XPath 篩選器的查詢條件。

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

參數

navigator
SeekableXPathNavigator

那 SeekableXPathNavigator 就是提供數據來測試。

傳回

true若資料SeekableXPathNavigator符合過濾條件;否則,。 false

例外狀況

navigator 是 null。

編譯器出錯了。

備註

該 SeekableXPathNavigator 類別擴充 XPathNavigator 了能更有效率執行查詢的方法。

適用於

Match(XPathNavigator)

評估該篩選器對指定 XPath 導航器的使用。

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

參數

navigator
XPathNavigator

那 XPathNavigator 就是提供數據來測試。

傳回

true 若 XPathNavigator 資料符合篩選條件; false 否則。

例外狀況

navigator 是 null。

編譯器出錯了。

適用於