POST Service

Function:

The tool POST enables you to execute a HTTP POST request on a Web application which creates a resource.

Tool Attribute:

Attribute Type Description
Response Body Resource Processing [O] Selection Specifies what type of resource operation should be executed based on the returned response body.

The resource operation uses all the properties mapped in the referenced response body output parameter file descriptor. Optional, not all resource operation types require property values to be successfully executed, for example, DELETE will remove the selected element even if no element ID properties are specified.

Attribute values:

  • COPY
  • DELETE
  • INSERT
  • INSERT_CHILD
  • MOVE
  • REFRESH
  • UPDATE

See Tool Descriptor for more information on resource processing.

Note: The Resource Processing attribute of the tool descriptor must be set to TOOL_DEFINED in order for the resource operation to be processed.
Media Type [M] Selection Specifies the media type that is acceptable for the response. Valid values are:
  • application/json (default)
  • application/octet-stream
Note: If the accepted Media Type is specified by a Request Header with the key "Accept", the header value has preference. Click here for more information on header field definitions.
Content Type [O] Selection Specifies the content type of the request payload. Valid values are:
  • application/json
  • application/octet-stream
  • text/plain
  • multipart/form-data

If the request payload is JSON formatted, it is not necessary to specify the Content Type attribute.

Note: If content type multipart/form-data is selected, a "Request Body Part" input parameter should be defined instead of a "Request Body" input parameter.

The main use for the content type attribute are file upload requests.

For example, a POST request for creating a new project entity with Response Body Resource Processing set to INSERT_CHILD will add a new project element as a child of the currently selected element in the Application Explorer view.

Note: Many REST clients do not return attributes of an entity created via a POST request. In these cases, the desired resource operation can usually be executed by setting up Response Body Resource Processing in an additional subsequent REST GET request.

Parameters:

Parameter Name I/O Type Description
URL [M] I String URL to the POST service of the Web application.
Realm [O] I String Realm enables mapping between client application and Web application. It is only relevant if an AWM application addresses different Web applications.
Request Body [O] I File File containing the post payload as expected by the Web application.
Request Body Part * [O] I File File containing the post form-data body part payload as expected by the Web application. It is relevant if the Content Type tool attribute is set to multipart/form-data.
Response Body * [O] O File File containing the post response sent from the server application.
Response Code [O] O String Response Code returned by the server application.
Response Header * [O] O String Reference to a response header field of the HTTP POST request.

Additional Parameter Attributes:

Parameter Name Attribute Description
URL Query Encoding Charset used to encode the URL.
Query Separator Symbol Symbol used to separate query parameters within the URL string.
Response Body Status Code Status code to be intercepted by custom error handling.
Note: This must be specified as a regular expression.
Response Header Name Name of the response header field.

Relationship: REST Tool Has Request Header

The relationship REST Tool Has Request Header enables you to specify a name/value pair to be sent in the HTTP request header.

If specified in an authentication request the name/value pair is sent with every HTTP request for the signed in session.

Attribute Type Description
Name String Name of the HTTP header field.
Value String Value of the HTTP header field.

Relationship: URL Has Query Parameter

The relationship URL has Query Parameter that enables you to specify parameters in the form of name/value pairs to be added to the HTTP request.

Attribute Type Description
Name String Name of the query parameter.
Value String Value of the query parameter.

Relationship: REST Tool Has Status Handler

The relationship REST Tool Has Status Handler enables you to specify the handling of certain status codes returned by the tool. It overwrites a general handling of the status codes specified under the REST connection.

Attribute Type Description
Allow Loop [M] Boolean Specifies whether the status handler can call an action which contains the tool for which the status handler is defined. Attribute values are:
true
The status handler can execute the action specified in the Perform Action, even if this contains the REST tool for which the status handler is defined.
false
The status handler stops executing when a cyclic execution is detected when the action specified in the Perform Action is called.

The default value is true.

Max Loop Count [O] Integer Specifies the maximum number of loop cycles when a loop is detected.

The default value is 3.

Note: This attribute is only relevant when the attribute Allow Loop is set to true. In this case, the action specified under the attribute Fail Action is executed as soon as the maximum loop count is reached.
Fail Action [O] Action Descriptor Specifies the action to be executed if the maximum loop count is reached in case of a cyclic execution.

This attribute is only relevant when the attribute Allow Loop is set to true.

Response Code Pattern [M] String Specifies the response code(s) to be handled by this status handler.

Must be specified as a regular expression.

Perform Action [M] Action Descriptor Specifies which action should be performed when the status handler is triggered.
Structure Descriptor [O] File Descriptor File containing the structure for the response that is specific for the matched status code.
Workflow Execution [M] Selection Specifies the impact on the original action of the handled REST tool.

It describes how the action containing the REST tool is continued after the status handler action specified under the attribute Perform Action was executed. Attribute values are:

Stop Execution
Stop the execution of the action that executes the REST tool.
Execute Tool Again
Execute the REST tool again and continue the execution of the action.
Continue Execution
Continue the execution of the action.

Example

The following example shows a tool to start the regions of an Enterprise Server:


Start Region Tool

The service gets an empty request body as its input file descriptor:


Empty Request Body

The file descriptor for the execution of the tool (response code=200) can be modelled as follows:


File Descriptor

The file descriptor to be used when the tool returns with a response code of 4nn (n numeric) can be modelled as follows:


File Descriptors to use on response code.