Skip to content

tutorial v3 request reply

Raymond Meester edited this page Mar 17, 2023 · 2 revisions

In this tutorial you learn how to create a request/reply flow.

We start with the flow created in the Quick Start.

Step 1: Clone flow

  • Like in tutorial1 clone the 'TestFlow'.

CloneFlow

Step 2: Configure the flow

  • Give the flow the name "Calculator".
  • Change the component of the To endpoint to "http".
  • Change the path to "www.dneonline.com/calculator.asmx".
  • Set the URI option Http Method to "POST".

SetHTTPEndpoint

Now create a new header:

  • Click on the '+' button of Header.

  • Give the header the name 'Reply'.

  • Add the following key/value pair:

    Key: 'Content-Type' Value: 'text/xml'

  • Save the header

CreateReplyHeader

  • On the To endpoint, click on "Add Response Step" button.
  • Add "C:/messages/reply" as path to Response Step.

After the changes you can save the flow.

Step 3: Test the flow

  • Create a file "calculator.xml". The file should have the following content:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:Add>
         <tem:intA>2</tem:intA>
         <tem:intB>2</tem:intB>
      </tem:Add>
   </soapenv:Body>
</soapenv:Envelope>
  • Save the file "calculator.xml" in the directory: "C:\messages\in".
  • Start the flow 'Calculator'.

You should now see the reply message in "C:\messages\reply". In the file you get the answer of the calculation (In case you didn't know already :))

Explanation on Request/Reply

By default a flow is one way (InOnly) so nothing is done with any reply. By setting the "Response" endpoint you can send the reply to any endpoint.

It's also possible that another flow uses the reply. For example you can use the 'VM' component with the path 'myReply'. Then you can set the FROM endpoint in another flow to: VM:myReply.


Now you completed this tutorial. You can continue to the next tutorial with an example of message queueing.

Clone this wiki locally