XPathMessageQuery 类

定义

计算 XPath 表达式以从消息中检索数据的消息查询。

public ref class XPathMessageQuery : System::ServiceModel::Dispatcher::MessageQuery
[System.Windows.Markup.ContentProperty("Expression")]
public class XPathMessageQuery : System.ServiceModel.Dispatcher.MessageQuery
[<System.Windows.Markup.ContentProperty("Expression")>]
type XPathMessageQuery = class
    inherit MessageQuery
Public Class XPathMessageQuery
Inherits MessageQuery
继承
XPathMessageQuery
属性

示例

下面的示例演示如何创建QueryCorrelationInitializer和使用方法。MessageQuerySetXPathMessageQuery

new SendReply
{
    Request = submitPO,
    Content = SendContent.Create(new InArgument<int>( (e) => po.Get(e).Id)), // creates a SendMessageContent
    CorrelationInitializers =
    {
        new QueryCorrelationInitializer
        {
            // initializes a correlation based on the PurchaseOrder Id sent in the reply message and stores it in the handle
            CorrelationHandle = poidHandle,
            MessageQuerySet = new MessageQuerySet
            {
                // int is the name of the parameter being sent in the outgoing response
                { "PoId", new XPathMessageQuery("sm:body()/ser:int", Constants.XPathMessageContext) }
            }
        }
    }
},

构造函数

名称 说明
XPathMessageQuery()

初始化 XPathMessageQuery 类的新实例。

XPathMessageQuery(String, XmlNamespaceManager)

使用指定的 XPath 表达式和 XmlNamespaceManager.. 初始化类的新实例XPathMessageQuery

XPathMessageQuery(String, XsltContext)

使用指定的 XPath 表达式和 XsltContext.. 初始化类的新实例XPathMessageQuery

XPathMessageQuery(String)

使用指定的 XPath 表达式初始化类的新实例 XPathMessageQuery

属性

名称 说明
Expression

获取或设置实例的 XPathMessageQuery XPath 表达式。

Namespaces

XmlNamespaceManager获取与此XPathMessageQuery实例关联的值。

方法

名称 说明
CreateMessageQueryCollection()

创建一个消息查询集合,以便在对消息执行多个查询时启用优化。

Equals(Object)

确定指定的对象是否等于当前对象。

(继承自 Object)
Evaluate<TResult>(Message)

根据指定的 Message值计算 XPath 查询。

Evaluate<TResult>(MessageBuffer)

根据指定的 MessageBuffer值计算 XPath 查询。

GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
ToString()

返回一个表示当前对象的字符串。

(继承自 Object)

适用于