Understanding Service Operation Handlers

Messaging handlers, or handlers are associated with a service operation on the Handlers tab of the Service Operations page.

Handlers define additional programming to be used with processing the message associated with the service operation.

The following are the different types of handlers:

  • On Notify

  • On Pre-notify

  • OnPost-notify

  • On Receive

  • On Request

  • On Response

  • On Route

  • On Send

The availability of each handler type depends on the type of service operation you are using. The following tables list the message types used for each service operation type and the handler types available for use.

Table 1: Handler Types and Messaging Types

Service Operation Type

On Notify Handler Type

On Pre-Notify Handler Type

On Post-Notify Handler Type

On Receive Handler Type

Asynchronous one-way

Request message

Request message

Request message

Request message

Asynchronous request / response

Request message

NA

NA

Request message

Asynchronous to synchronous

Request message

NA

NA

NA

Synchronous

NA

NA

NA

NA

Table 2: Handler Types and Messaging Types (cont.)

Service Operation Type

On Request Handler Type

On Response Handler Type

On Route Handler Type

On Send Handler Type

Asynchronous one-way

NA

NA

Request message

Request message

Asynchronous request / response

NA

Response message

*Request message

*Response message

Request message

Asynchronous to synchronous

Request message

Response message

*Request message

*Response message

Request message

Synchronous

Request message

NA

Request message

Request message

Note: For On Route with On Send, the message structure is a request message. For On Route with On Receive, the message structure is a response message.

The On Response handler type is used to identify the type of On Notify event to be fired. For example, assume there are four On Notify handlers that are to be fired—three are general On Notify events, that is, the message is processed as part of the request, and the fourth is a response to the original asynchronous request. The fourth one is specified with a handler type of On Response, and the application class selected is the base class OnNotify.

Table 3: Handler Types and Messaging Types (REST service operations).

REST Provider HTTP Method

On Request Handler Type

On Response Handler Type

On Route Handler Type

On Send Handler Type

Delete

NA

NA

NA

NA

Get

NA

NA

NA

NA

Head

NA

NA

NA

NA

Patch

Request message

NA

NA

NA

Post

Request message

NA

NA

NA

Put

Request message

NA

NA

NA

There are no handlers for REST consumer service operations. You may add connector properties to consumer service operations on the routing definition using the Routings-Connector Properties page or add them dynamically by using PeopleCode.

See Defining and Overriding Gateway and Connector PropertiesUsing PeopleCode to Manage REST Service Operations.