3.4.2 Sequence of Events

The following diagram shows the sequence of events for reliable messaging with flow control.

Reliable messaging with flow control

Figure 19: Reliable messaging with flow control

As shown in the preceding diagram, the following messages are the actual messages  that are sent between the RM Source (RMS) and the RM Destination (RMD). The body of each message is not shown, because it is not relevant to the advanced flow-control extension (AFCE) to the Web Services Reliable Messaging Protocol ([WSRM]). The purpose of each message is not included in this example. For more details on each message type, see the WSRM specifications [WSRM1-0], [WSRM1-1], and [WSRM1-2].

  1. CreateSequence

    The RMS sends a CreateSequence message, as specified in [WSRM1-1] section 3.4, to the RMD.

  2. CreateSequenceResponse

    The RMD sends a CreateSequenceResponse message, as specified in [WSRM1-1] section 3.4, to the RMS.

  3. Sequence (MessageNumber = 1)

    The RMS sends the first message to the RMD with a <MessageNumber> value of 1 and an <AckRequested> header block in the header to signal to the RMD that the RMS is requesting a <SequenceAcknowledgement> to be returned as specified in [WSRM1-1] section 3.3.

     <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
                 xmlns:r=http://schemas.xmlsoap.org/ws/2005/02/rm
                 xmlns:a="http://www.w3.org/2005/08/addressing">
       <s:Header>
         <r:AckRequested>
           <r:Identifier>urn:uuid:ed0fc900-3bef-43a6-a5a0-83ed5935e2de</r:Identifier>
         </r:AckRequested>
         <r:Sequence s:mustUnderstand="1">
           <r:Identifier>urn:uuid:ed0fc900-3bef-43a6-a5a0-83ed5935e2de</r:Identifier>
           <r:MessageNumber>1</r:MessageNumber>
         </r:Sequence>
         <a:Action s:mustUnderstand="1"> http://Server/AFCEExample </a:Action>
       </s:Header>
       <s:Body> </s:Body>
     </s:Envelope>
      
    
  4. SequenceAcknowledgement (BufferRemaining = 0)

    This message contains the <SequenceAcknowledgement> header block, (as specified in [MS-WSRVCRM] section 2.2.1) , that is sent by the RMD in response to message 1.

    The RMD responds with <AcknowledgementRange> values of 1, 1 to acknowledge receipt of the first message, but indicates with a BufferRemaining value of zero that it cannot receive more messages until the Application Destination (AD) finishes processing the first message.

     <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
                 xmlns:r="http://schemas.xmlsoap.org/ws/2005/02/rm"
                 xmlns:a="http://www.w3.org/2005/08/addressing">
       <s:Header>
         <r:SequenceAcknowledgement>
           <r:Identifier>urn:uuid:ed0fc900-3bef-43a6-a5a0-83ed5935e2de</r:Identifier>
           <r:AcknowledgementRange Lower="1" Upper="1"/>
           <netrm:BufferRemaining xmlns:netrm="http://schemas.microsoft.com/ws/2006/05/rm">0</netrm:BufferRemaining>
         </r:SequenceAcknowledgement>
         <a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement</a:Action>
       </s:Header>
       <s:Body/>
     </s:Envelope>
      
    
  5. SequenceAcknowledgement (BufferRemaining = 1)

    The RMD responds with <AcknowledgementRange> values of 1, 1 to acknowledge receipt of the first message and with a <BufferRemaining> value of 1 in the header block to indicate that the RMD can receive another message.

     <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
                 xmlns:r="http://schemas.xmlsoap.org/ws/2005/02/rm"
                 xmlns:a="http://www.w3.org/2005/08/addressing">
       <s:Header>
         <r:SequenceAcknowledgement>
           <r:Identifier>urn:uuid:ed0fc900-3bef-43a6-a5a0-83ed5935e2de</r:Identifier>
           <r:AcknowledgementRange Lower="1" Upper="1"/>
           <netrm:BufferRemaining xmlns:netrm="http://schemas.microsoft.com/ws/2006/05/rm">1</netrm:BufferRemaining>
         </r:SequenceAcknowledgement>
         <a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement</a:Action>
       </s:Header>
       <s:Body/>
     </s:Envelope>
      
    
  6. Sequence (MessageNumber = 2)

    The RMS sends a second message to the RMD with a <MessageNumber> value of 2 and an <AckRequested> element header block in the header to signal to the RMD that the RMS is requesting a <SequenceAcknowledgement> to be returned, as specified in [WSRM1-1] section 3.3.

     <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
                 xmlns:r="http://schemas.xmlsoap.org/ws/2005/02/rm"
                 xmlns:a="http://www.w3.org/2005/08/addressing">
       <s:Header>
         <r:AckRequested>
           <r:Identifier>urn:uuid:ed0fc900-3bef-43a6-a5a0-83ed5935e2de</r:Identifier>
         </r:AckRequested>
         <r:Sequence s:mustUnderstand="1">
           <r:Identifier>urn:uuid:ed0fc900-3bef-43a6-a5a0-83ed5935e2de</r:Identifier>
           <r:MessageNumber>2</r:MessageNumber>
         </r:Sequence>
         <a:Action s:mustUnderstand="1"> http://Server/AFCEExample</a:Action>
       </s:Header>
       <s:Body> </s:Body>
     </s:Envelope>
      
    
  7. SequenceAcknowledgement (BufferRemaining = 0)

    This message contains the <SequenceAcknowledgement> element header block, (as specified in [MS-WSRVCRM] section 2.2.1) sent by the RMD in response to message 2.

    The RMD responds to the RMS with <AcknowledgementRange> values of 1, 2 to acknowledge receipt of the first and second messages, but indicates with a <BufferRemaining> value of zero that it cannot receive more messages until AD finishes processing the second message.

     <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
                 xmlns:r="http://schemas.xmlsoap.org/ws/2005/02/rm"
                 xmlns:a="http://www.w3.org/2005/08/addressing">
       <s:Header>
         <r:SequenceAcknowledgement>
           <r:Identifier>urn:uuid:ed0fc900-3bef-43a6-a5a0-83ed5935e2de</r:Identifier>
           <r:AcknowledgementRange Lower="1" Upper="2"/>
           <netrm:BufferRemaining xmlns:netrm="http://schemas.microsoft.com/ws/2006/05/rm">0</netrm:BufferRemaining>
         </r:SequenceAcknowledgement>
         <a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement</a:Action>
       </s:Header>
       <s:Body/>
     </s:Envelope>
      
    
  8. SequenceAcknowledgement (BufferRemaining = 1)

    After the AD finishes processing the first message and starts processing the second message, the RMD sends a <SequenceAcknowledgement> header block (as specified in [MS-WSRVCRM] section 2.2.1) with a <BufferRemaining> value of 1 to inform the RMS that it can receive another message.

     <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
                 xmlns:r="http://schemas.xmlsoap.org/ws/2005/02/rm"
                 xmlns:a="http://www.w3.org/2005/08/addressing">
       <s:Header>
         <r:SequenceAcknowledgement>
           <r:Identifier>urn:uuid:ed0fc900-3bef-43a6-a5a0-83ed5935e2de</r:Identifier>
           <r:AcknowledgementRange Lower="1" Upper="2"/>
           <netrm:BufferRemaining xmlns:netrm="http://schemas.microsoft.com/ws/2006/05/rm">1</netrm:BufferRemaining>
         </r:SequenceAcknowledgement>
         <a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement</a:Action>
       </s:Header>
       <s:Body/>
     </s:Envelope>
      
    
  9. Sequence (MessageNumber = 3)

    The RMS sends a third message to the RMD with a <MessageNumber> value of 3 and an <AckRequested> header block in the header to signal to the RM Destination that the RM Source is requesting a <SequenceAcknowledgement> to be returned, as specified in [WSRM1-1] section 3.3. It adds a <LastMessage> element in the sequence block to indicate to the RMD that this is the last message in the sequence. This message contains no Application message, and its Action URI is "http://schemas.xmlsoap.org/ws/2005/02/rm/LastMessage".

     <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
                 xmlns:r="http://schemas.xmlsoap.org/ws/2005/02/rm"
                 xmlns:a="http://www.w3.org/2005/08/addressing">
       <s:Header>
         <r:AckRequested>
           <r:Identifier>urn:uuid:ed0fc900-3bef-43a6-a5a0-83ed5935e2de</r:Identifier>
         </r:AckRequested>
         <r:Sequence s:mustUnderstand="1">
           <r:Identifier>urn:uuid:ed0fc900-3bef-43a6-a5a0-83ed5935e2de</r:Identifier>
           <r:MessageNumber>3</r:MessageNumber>
         </r:Sequence>
         <a:Action s:mustUnderstand="1"> http://Server/AFCEExample</a:Action>
       </s:Header>
       <s:Body> </s:Body>
     </s:Envelope>
      
    
  10. SequenceAcknowledgement (LastMessage)

    This message contains the <SequenceAcknowledgement> header block (as specified in [MS-WSRVCRM] section 2.2.1) sent by the RMD in response to message 3.

    The RMD informs the RMS that it has received messages 1 through 3 in the sequence. Message 3 is the last message.

     <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
                 xmlns:r="http://schemas.xmlsoap.org/ws/2005/02/rm"
                 xmlns:a="http://www.w3.org/2005/08/addressing">
       <s:Header>
         <r:SequenceAcknowledgement>
           <r:Identifier>urn:uuid:ed0fc900-3bef-43a6-a5a0-83ed5935e2de</r:Identifier>
           <r:AcknowledgementRange Lower="1" Upper="3"/>
           <netrm:BufferRemaining xmlns:netrm="http://schemas.microsoft.com/ws/2006/05/rm">0</netrm:BufferRemaining>
         </r:SequenceAcknowledgement>
         <a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement</a:Action>
       </s:Header>
       <s:Body/>
     </s:Envelope>
      
    
  11. TerminateSequence()

    After receiving acknowledgement of the last message, the RMS sends a <TerminateSequence> element, as specified in [WSRM1-1] section 3.5.

     <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
                 xmlns:a="http://www.w3.org/2005/08/addressing">
       <s:Header>
         <a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/rm/TerminateSequence</a:Action>
       </s:Header>
       <s:Body>
         <TerminateSequence xmlns="http://schemas.xmlsoap.org/ws/2005/02/rm">
           <Identifier>urn:uuid:ed0fc900-3bef-43a6-a5a0-83ed5935e2de</Identifier>
         </TerminateSequence>
       </s:Body>
     </s:Envelope>