Incoming Web Service Requests Tutorial

From PresenceWiki
Revision as of 10:19, 21 July 2010 by Admin (Talk | contribs)

Jump to: navigation, search
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:

  1. Start of Task Node
  2. Require Variable Node - ${radius}
  3. Set Variable Node - ${circumference}
  4. 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:

2: Creating the Web Service

To expose our Task as a Web Service, first launch the Live Tasks Queue