Add a RESTful Service action
Use a RESTful web service to integrate your form with external applications.
- On the Form Modeling bar, click Actions.
- On the Actions page, click Add .
- On the Type list, select RESTful Service.
- Enter a Name and Description for the action.
- Optionally, configure a unique action for each language separately. See Configure multilingual actions for a form or control for more information.
-
To select a web service for your web service action, consume the
web service in the
Web Service box. Example:
http://www.thomas-bayer.com/sqlrest/CUSTOMER.
The base URL is automatically populated, based on the RESTful web service selected.
You can reuse the base URL parameters by copying and pasting it in the base URL parameters of another restful services. - If required, enter the URL parameters, which are optional parameters of type String that influence the returned results in the URL Parameters box. You can map the URL by consuming a single form or global variable of type String, or form field, or dynamically defining the URL as a combination of static value, variables, and form field.
-
To retrieve the data:
- On the Verb list, select GET.
-
In the
Response group, do
either of the following:
-
To map the entire output to a single form variable or global variable, click Variables and consume the variable of type String or XML in the Value box.
-
To define the elements to extract from it, click Expression, and provide the correct path using a static or dynamic value.
-
-
To update, insert or delete the data:
-
On the
Verb list, select
PUT to update,
POST to insert or
DELETE to delete the
data.
In case of PUT and POST, you can reuse the request by coping and pasting it in PUT and POST verb of another restful service.
-
Under
Request, do either of
the following:
-
Map the entire output to a single form variable or global variable by consuming a variable of type String or XML in the Request box.
-
Define a combination of static text, and variables (consume the variables).
-
-
On the
Verb list, select
PUT to update,
POST to insert or
DELETE to delete the
data.
- On the Type list, select the request type (JSON or XML).
-
To allow a job to suspend if an error is found and to display the
error code, in the Error Handling group, do the following:
- Select Yes for Stop on Error. (Default: No; this means that the job will complete even if an error is found.)
- Specify a static value or consume the variable in the Error Code box.
-
Click
OK.
The newly created action is added to the table.
- Click Save.
-
Associate the action with the control to trigger this action. To
call the RESTful Service action upon form load, associate the action with the
form. See
Associate an action with a form or
control.
When this action is triggered, the RESTful web service is executed and the output and status code are handled as configured.