In this post we’re going to show an example of a high level workflow composed of simple workflows generated with the SOAP plug-in.
First of all, we need a vCO server with the SOAP plug-in installed on it. The process of installing the SOAP plug-in is quite straightforward, you just have to follow the steps described on the SOAP plug-in User Guide.
Now, the sample scenario that we want to run is the following:
The Web Services that we will use are available on this website http://www.webservicex.net/ and these are:
- GeoIPService (http://www.webservicex.net/geoipservice.asmx?WSDL)
- Global Weather (http://www.webservicex.net/globalweather.asmx?WSDL)
So, let’s see what we have to do in order to compose our scenario. We are omitting the very basic details about how to do some things since they are described on the SOAP plug-in User Guide as well.
Add the 2 new SOAP hosts, one for each WSDL file
Create 3 new workflows from the SOAP operations we are going to use
These operations are:
- GetGeoIPContext – to get our country from our public IP address.
- GetCitiesByCountry – to get the list of cities available for our country.
- GetWeather – to get the weather from the city chosen by the user.
Create a new workflow that will combine the previously created workflows
The schema of that new workflow will look like this:
And the workflow defines also the following attributes:
Complete the additional scriptable tasks
To connect the different generated workflows we need to add a couple of scriptable tasks in order to adapt the output of one workflow as the input of the next one. Also we need to define a User Interaction node to allow the user to choose a city. And we may add a final scriptable tasks to filter and pretty print the result of our high level workflow.
- Set country
- Set cities
- Choose a city
- Print weather
We need also to associate the inputs and outputs from all the invoked workflows and scriptable tasks with the attributes of the main workflow, but this is a quite easy task since the names from both, attributes and workflow’s inputs/outputs are very descriptive.
Run the workflow
When we run the workflow we have no inputs to introduce:
At some point the workflow waits for a user interaction and we have to answer:
And at the end the workflow prints the selected info in the log tab:
That was just a simple example about how to compose a higher level workflow by combining a set of workflows automatically generated by the SOAP plug-in. As you can see the complex parts are not the different SOAP invocations (the generated workflows handle them) but processing and adapting the different outputs and inputs. And these parts will be more or less difficult depending on the Web Services that you have to use.