WSPreProcessing

Specify functions in a REST web service module that are used as preprocessing request handlers.

Syntax

WSPreProcessing = "[ wsquery | wsheader | wsparam ]"
Where:
  1. WSPreProcessing has options for query, header, and parameter: wsquery, wsheader, or wsparam. It is a string value setting.
  2. When used on its own without an option, WSPreProcessing is set on a callback function for the body of the REST request.
WSPreProcessing is an attribute set on a BDL private function in a REST web service module.

Usage

You use this attribute to specify callback functions in the REST service module that are called when an incoming request is received and before the REST engine has processed it. The callback function must be one of the predefined callback functions. For more details, see Configuring callback functions and Examples of callback functions. The callback function typically modifies the query, header, parameter, or the body of the REST request.

PRIVATE # REST Query string incoming callback
FUNCTION QueryPreCallback(query STRING, value STRING) ATTRIBUTES (WSPreProcessing="wsquery") RETURNS (STRING)
  DISPLAY "Query:",query
  DISPLAY "Value:",value
  RETURN value # new query value
END FUNCTION

Example using WSPreProcessing

For sample callback functions, go to Examples of callback functions.