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:
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.
Copyright © Cloud Software Group, Inc. All rights reserved.