XPathMessageQuery XPathMessageQuery XPathMessageQuery XPathMessageQuery Class

定义

一个用于计算 XPath 表达式以检索消息中的数据的消息查询。A message query that evaluates XPath expressions to retrieve data from a message.

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

示例

下面的示例演示如何使用 QueryCorrelationInitializer 创建 MessageQuerySet 并指定 XPathMessageQueryThe following example shows how to create a QueryCorrelationInitializer and specify a MessageQuerySet using a XPathMessageQuery.

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() XPathMessageQuery()

初始化 XPathMessageQuery 类的新实例。Initializes a new instance of the XPathMessageQuery class.

XPathMessageQuery(String) XPathMessageQuery(String) XPathMessageQuery(String) XPathMessageQuery(String)

使用指定的 XPath 表达式初始化 XPathMessageQuery 类的新实例。Initializes a new instance of the XPathMessageQuery class with the specified XPath expression.

XPathMessageQuery(String, XmlNamespaceManager) XPathMessageQuery(String, XmlNamespaceManager) XPathMessageQuery(String, XmlNamespaceManager) XPathMessageQuery(String, XmlNamespaceManager)

使用指定的 XPath 表达式和 XPathMessageQuery 初始化 XmlNamespaceManager 类的新实例。Initializes a new instance of the XPathMessageQuery class with the specified XPath expression and XmlNamespaceManager.

XPathMessageQuery(String, XsltContext) XPathMessageQuery(String, XsltContext) XPathMessageQuery(String, XsltContext) XPathMessageQuery(String, XsltContext)

使用指定的 XPath 表达式和 XPathMessageQuery 初始化 XsltContext 类的新实例。Initializes a new instance of the XPathMessageQuery class with the specified XPath expression and XsltContext.

属性

Expression Expression Expression Expression

获取或设置 XPathMessageQuery 实例的 XPath 表达式。Gets or sets the XPath expression for the XPathMessageQuery instance.

Namespaces Namespaces Namespaces Namespaces

获取与此 XmlNamespaceManager 实例关联的 XPathMessageQueryGets the XmlNamespaceManager associated with this XPathMessageQuery instance.

方法

CreateMessageQueryCollection() CreateMessageQueryCollection() CreateMessageQueryCollection() CreateMessageQueryCollection()

创建一个消息查询集合,它可用于在对一个消息执行多个查询时启用优化。Creates a message query collection that enables optimizations when executing multiple queries against a message.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
Evaluate<TResult>(Message) Evaluate<TResult>(Message) Evaluate<TResult>(Message) Evaluate<TResult>(Message)

针对指定的 Message 计算 XPath 查询。Evaluates the XPath query against the specified Message.

Evaluate<TResult>(MessageBuffer) Evaluate<TResult>(MessageBuffer) Evaluate<TResult>(MessageBuffer) Evaluate<TResult>(MessageBuffer)

针对指定的 MessageBuffer 计算 XPath 查询。Evaluates the XPath query against the specified MessageBuffer.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

适用于