Configuring for Response (Inbound or Fault) Flow

You can configure inbound messages received on a reference ("out|fault" part of "in-out" MEP) by configuring the following:

  • Supported Type: Basic, Bag
  • Supported Header Source: HTTP_HEADERS
  • Direction: Inbound/Fault

Add the following code after receiving the service operation response:

To retrieve a 'Basic' context parameter:
//Retrieve the callbackContext (Response/Fault flow) from the mutableRequestContext
CallbackContext callbackContext = createMutableRequestContext.getCallbackContext();

callbackContext.getParameter("bookCategoryCP", String.class));

The return value of above getParameter() call corresponds to the HTTP Header value of the bookCategory header (corresponding to the context parameter bookCategoryCP ) in the incoming REST Response.

To retrieve a context parameter 'Bag':
//Retrieve the callbackContext (Response/Fault flow) from the mutableRequestContext
CallbackContext callbackContext = createMutableRequestContext.getCallbackContext();

HashMap<String, String> responseHeadersAllCP_reference_map = (HashMap<String, String>)callbackContext.getParameter("responseHeadersAllCP", Map.class);

The HashMap responseHeadersAllCP_reference_map contains all HTTP Headers (user-defined and native HTTP Headers, corresponding to context parameter responseHeadersAllCP) in the incoming REST Response.