Editare

Partajați prin


XPathMessageQuery Class

Definition

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
[<System.Windows.Markup.ContentProperty("Expression")>]
type XPathMessageQuery = class
    inherit MessageQuery
Public Class XPathMessageQuery
Inherits MessageQuery
Inheritance
XPathMessageQuery
Attributes

Examples

The 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) }
            }
        }
    }
},

Constructors

XPathMessageQuery()

Initializes a new instance of the XPathMessageQuery class.

XPathMessageQuery(String, XmlNamespaceManager)

Initializes a new instance of the XPathMessageQuery class with the specified XPath expression and XmlNamespaceManager.

XPathMessageQuery(String, XsltContext)

Initializes a new instance of the XPathMessageQuery class with the specified XPath expression and XsltContext.

XPathMessageQuery(String)

Initializes a new instance of the XPathMessageQuery class with the specified XPath expression.

Properties

Expression

Gets or sets the XPath expression for the XPathMessageQuery instance.

Namespaces

Gets the XmlNamespaceManager associated with this XPathMessageQuery instance.

Methods

CreateMessageQueryCollection()

Creates a message query collection that enables optimizations when executing multiple queries against a message.

Equals(Object)

Determines whether the specified object is equal to the current object.

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

Evaluates the XPath query against the specified Message.

Evaluate<TResult>(MessageBuffer)

Evaluates the XPath query against the specified MessageBuffer.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to