Create a "Hello, World!" Job

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  Job Configuration Examples >

Create a "Hello, World!" Job

This example shows you how to create a simple job that outputs the text "Hello, World!" in the browser. The text will be created by means of a FlowForce expression. You will be able to trigger the job on demand by clicking a link in the browser (that is, the job will be exposed as a Web service).

 

Prerequisites

Required licenses: FlowForce Server
FlowForce Server must be running at the configured network address and port (see Setting the Network Address and Port)
You have a FlowForce Server user account with permissions to one of the containers (by default, the /public container used in this example is accessible to any authenticated user).

 

Creating the job

1.Log on to FlowForce Server and navigate to a container where you have permission to create new jobs (this example uses the default /public container).
1.Click Create, and then select Create job.
2.Enter the job title and description.

helloworld01

3.Add a new execution step which calls the built-in function builtin_function/system/compute.

helloworld02

4.In the Expression field, enter the text 'Hello, World', enclosed within single quotes. The content of this field represents a FlowForce Server expression.

helloworld03

5.Declare the execution result as string.

helloworld04

6.Select the Make this job available via HTTP... check box and type "HelloWorld" as service name (see Exposing Jobs as Web Services ).

helloworld05

7.Under "Credentials", select an existing credential record or specify a local credential (see Credentials ).
8.Click Save.

 

Running the job

You have now finished creating a job that computes the string value "Hello, World!" and returns it as the job result. To test the job, enter http://127.0.0.1:4646/service/HelloWorld in the browser's address bar, provided that FlowForce Server runs at the default host and port name. If you have defined other host and port settings in the Configuration page (see Setting the Network Address and Port ), change the address accordingly. If prompted for credentials when accessing the Web service, supply the same credentials you use to log on to FlowForce Server.

 

If you use Internet Explorer to test FlowForce Server jobs exposed as Web services, you may need to disable the "Show friendly HTTP error messages" option in the Advanced tab.

 

If the job executes successfully, the browser displays the output of the job:

 

Hello, World!

 

If the job fails, the browser displays a "Service execution failed" message. In this case, check the log of the job in FlowForce Server to identify the error (see Viewing the Job Log).


© 2019 Altova GmbH