Show TOC

Message HeadersLocate this document in the navigation structure

Headers are key value parameters that can be used to influence the Integration Gateway runtime flow.

Headers can be fetched and set using the methods given below in the message object:
  • Use message.getHeaders() to fetch all the headers which are available for further processing.
  • Use message.getHeader(HeaderName, HeaderType) to fetch the header based on the header's name and type.
  • Use message.setHeader(Name, Value) to set the header, based on name and value.
  • Use message.setHeaders(<HashMap of name-value pairs>) to set multiple headers at the same time.
Here are few examples for the above methods:
  • To access ODataContext, use: message.getHeaders().get("ODataContext");
  • To access a string header based on the header name and type, for example, to access HTTP status code, use: message.getHeader("HttpStatusCodes")
  • To set the header to indicate that delta token is implemented, use: message.setHeader("DeltaImplemented", true);
  • To set multiple headers together, create a HashMap of name-value pairs of the headers, then use the setHeaders() method.
    deltaMap = new HashMap()
    deltaMap.put("DeltaToken", token)
    deltaMap.put("DeletedEntities",deletedItems)
    
    message.setHeaders(credentialsMap)
  • To access a string header based on the header name and type, use: message.getHeader("HttpStatusCodes")
Message Headers Common for all Data Sources
Header Name and Description Example

Use ODataContext header o fetch the HTTP header details (read-only). See the Javadoc at Apache Olingo™, Interface ODataContextInformation published on non-SAP site for more information.

To get the ODataContext, use:
message.getHeaders().get("ODataContext");
You can use different methods on the context object once it is fetched. For example, to retrieve the content type and CSRF token from the HTTP request of context object, use:
context.getRequestHeaders().get("Content-Type").get(0);
context.getRequestHeaders().get("X-Csrf-Token").get(0);
Use ODataMethod to determine the OData method that is being invoked, which might be helpful when you have to write a logic for a specific ODataMethod call, for example, GET_FEED or GET_ENTRY and so on.
Determine ODataMethod using:
message.getHeaders().get(“ODataMethod”)

Use UriInfo to fetch the details of the URI and the system query parameters passed with the URI. See the Javadoc at Apache Olingo™, Interface UriInfoInformation published on non-SAP site for more information.

  • To get the UriInfo object, you can use: message.getHeaders().get("UriInfo");.

    Once the UriInfo object is obtained, you can use different methods to retrieve system query and custom query parameters.

  • To get the start entity set, use: uriInfo. getStartEntitySet().getName()

  • To get the target entity set, use: uriInfo. getTargetEntitySet().getName()

  • To get the filter expression, use: uriInfo.getFilter().getExpressionString()

  • To get the deltatoken value from the custom query options, use: uriInfo. getCustomQueryOptions().get(“!deltatoken”)

  • To get the navigation segments from the UriInfo, use: uriInfo.getNavigationSegments()

  • To get the $top for the entity, use: uriInfo.getTop()

Use ODataResponseType to fetch or set specific response type to the OData response. For delta token handling, set ODataResponseType to DeltaResponseMap:
message.setHeader("ODataResponseType", "DeltaResponseMap");
Use DeltaToken to set the delta token value.
message.setHeader("DeltaToken", token);
Message Headers Specific to JDBC Data Source
Header Name and Description Example
Use JDBC_TABLE_MAPPING header to set the HashMap which has information to map OData entity set names to JDBC table names.
message.setHeader("JDBCTableNameMapping", tableMap);
Use JDBC_PROP_MAPPING header to set the HashMap, which has information to map OData property names to JDBC table column names.
message.setHeader("JDBCPropertyNameMapping", entitiesMap);
Message Headers Specific to JPA Data Source
Header Name and Description Example
Use ENTITYSET_MAPPING header to set the HashMap, which has information to map OData entity set names to JPA entity names.
message.setHeader("EntitySetMapping", entitySetMap);
Use PROPERTY_MAPPING header to set the HashMap, which has information to map OData property names to JPA property names.
message.setHeader("PropertyMapping", propMap);
Message Headers Specific to REST Services
Header Name Description
RelativeUri The value of this header is appended to the destination URL at the runtime to make a complete endpoint REST URL.