Deploying Processes as ReSTful HTTP Web Service
To provide a Technical Process as operation of a ReSTful web service within the Webservice Configuration Editor, proceed as follows:
- If needed, create a new node (corresponds to a URL part of the web service) within the tree structure, see Editing the Web Service Configuration graphically.
- Choose Add HTTP ReST Service to create a new HTTP ReST service for the desired node (with the type
Constant
,Variable
orRemainder
) and adjust the (security) properties, if required. Choose Add HTTP ReST Operation in the context menu to create a new operation for the HTTP ReST service or select an entry in the Operations table, which shall be overwritten.
You can assign an operationGET
,POST
,PUT
,DELETE
once for each service or enter any operation name; it will be distinguished between upper case and lower case.Drag and drop a process from the repository to the desired operation in order to assign the process path.
- Define an input mode and an output mode for each operation to specify which XML structure is expected and created.
If required, enable the use of placeholders in order to enable parameter handling for the web service operation, and to hand over HTTP request information to the process context as placeholders.
If option
Enabled
is selected, the following placeholders with HTTP request information are are available within the X4 process context, e.g. within XSL mappings:REQUEST_PARAMETER_<Name>
: Desired parameter (case-sensitive!)REQUEST_HEADER_<NAME>
: Desired HTTP header (only uppercase!)REQUEST_METHOD
REQUEST_SCHEME
REQUEST_PATH
REQUEST_FULL_PATH
REQUEST_REMOTE_ADDRESS
REQUEST_REMOTE_PORT
REQUEST_REMOTE_USER
REQUEST_LOCAL_ADDRESS
REQUEST_LOCAL_PORT
REQUEST_SERVER_NAME
REQUEST_SERVER_PORT
- Define security options such as
Realm
orGuest Allowed
for the operation.
Example: ReSTful web service configuration (excerpt from XML storage format)
<Constant value="example">
<Service type="Http">
<Operation name="GET" process="x4db:/1/RestExamples/http/DirectOutput.wrf">
<InputHandler type="HTTP-MetaXml" />
<OutputHandler type="HTTP-Content" />
</Operation>
</Service>
</Constant>