Incoming Web Service Requests Tutorial
Tutorial Pages > Incoming Web Service Requests Tutorial |
This document gives a step-by-step guide to exposing a Presence Task as a Web Service.
1: Creating the Task
The first step is to create our Task. For the purposes of this demonstration we will create a Web Service that calculates the circumference of a circle given the radius. The Task to do this is very simple and comprises of:
- Start of Task Node
- Require Variable Node - ${radius}
- Set Variable Node - ${circumference}
- End of Task Node
The variable ${radius} will be an incoming parameter and ${circumference} will be an outgoing parameter.
To calculate the circumference we call the following function in our Set Variable Node (3):
&eval {"2 * ${radius} * PI"}
Here is a view of the Task, which can be downloaded here:
http://www.international-presence.com/wikidocs/images/calc_circumference_taskview.png
2: Creating the Web Service
To expose our Task as a Web Service, first launch the Live Tasks Queue