<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
      "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  <title>WSO2 ESB - RMSequence Mediator </title>
  <link href="css/esb-docs.css" rel="stylesheet" />
  <link href="styles/dist-docs.css" rel="stylesheet" type="text/css"
  media="all" />
</head>

<body>
<h2>RMSequence</h2>

<p>The &lt;RMSequence&gt; mediator can be used to create a sequence of messages
to communicate via WS-Reliable Messaging with an WS-RM enabled endpoint
(&lt;enableRM&gt;). The simple use case of this mediator is to specify a
single="true" property, because this means that only one message is involved in
the same sequence. However if multiple messages should be sent in the same
sequence, the correlation property should be used with a XPath expression that
selects an unique element value from the incoming message. With the result of
the XPath expression, Synapse can group messages together that belong to the
same sequence. To close the sequence neatly, for the last message of the
sequence also an XPath expression should be specified. With the version
attribute the WS-RM specification version to be used can be specified, 1.0 or
1.1. </p>

<h3>Syntax</h3>
<pre xml:space="preserve"> &lt;RMSequence (correlation="xpath" [last-message="xpath"]) | single="true" [version="1.0|1.1"]/&gt;</pre>

<h3>UI Configuration</h3>

<p><img src="../rmsequence-mediator/docs/images/rmsequence_screenshot.jpg"
alt="" /> </p>
<ul>
  <li>WS-RM Spec Version: Reliable Messaging Specification version: possible
    values 1.0 /1.1 </li>
  <li>Message Sequence: Whether to use a single message or a multiple
    correlated messages 
    <ul>
      <li>Single Message - Making single message reliable. </li>
      <li>Correlated Sequence - Make multiple correlated message reliable. When
        you select this option you have to provide the following two fields
        appears in the panel. 
        <ul>
          <li>Sequence XPath: The xpath expression that selects an unique
            element value from the incoming message </li>
          <li>Last Message XPath: The xpath expression that identify the last
            message </li>
        </ul>
        <em>NOTE: You can define prefixes for the namespaces used in these
        expression from the right hand side link named "Namespaces".</em> </li>
    </ul>
  </li>
</ul>
  <div class="image">
    <img src="../rmsequence-mediator/docs/images/correlated_sequence.jpg" alt="" />
  </div>
<p>Specifying Correlated Sequences </p>

<h3>Example</h3>
<pre xml:space="preserve">
&lt;in&gt;
    &lt;RMSequence single="true" version="1.0"/&gt;
    &lt;send&gt;
       &lt;endpoint name="reliable"&gt;
          &lt;address uri="http://localhost:9000/services/ReliableStockQuoteService"&gt;
             &lt;enableRM/&gt;
             &lt;enableAddressing/&gt;
          &lt;/address&gt;
       &lt;/endpoint&gt;
    &lt;/send&gt;
&lt;/in&gt;
</pre>

<p>In the above scenario, WS-RM is engaged to the endpoint using the &lt;enableRM/&gt;
    tag. It is possible to engage WS-RM to both Address and WSDL endpoints using this tag. In addition
    to the RM enabled endpoint, RMSequence mediator is specified before the send mediator. This mediator is
    used to specify the set of messages to be sent using a single RM sequence. In this sample it is specified as
    single message per sequence. It also specifies the version of the WS-RM to be used.</p>

<p></p></body>
</html>
