-
-
Notifications
You must be signed in to change notification settings - Fork 9
tutorial v3 request reply
In this tutorial you learn how to create a request/reply flow.
We start with the flow created in the Quick Start.
- Like in tutorial1 clone the 'TestFlow'.
- 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".
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
- 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.
- 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 :))
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.