53. Example

    In this example, we will demonstrate how to create a Data Service that returns the message converted to upper case. The web service will be available on


    Creating Data Service

    Create a new Data Service REST Job. Right click the data-service directory in the project. New  Other. CloverDX  Data Service REST Job Enter the file name message and click Finish.

    Remove other components except Input and Output.

    Insert the GetJobInput component: Press Shift+Space and choose the component.

    Connect GetJobInput and Output with an edge.

    Assign metadata to the edge. The metadata should contain one string field.

    In GetJobInput, update the transformation to contain the following mapping:

    function integer transform() {
        string text = getRequestParameter("text");
        string upperText = upperCase(text);
        return ALL;

    In Output set Format to custom.

    Publishing the Web Service

    To publish the web service, switch to Endpoint Configuration. Set Endpoint URL.

    Check request methods GET and POST.

    Click Publish.

    Verifying Functionality

    To check that the service works, query the Data Service, e.g. with wget (or curl). You can also use HTTPConnector.

    wget --user clover --password clover "" -O file.txt

    The Data Service will return HELLO. See the content of file.txt file.