Add HTTP Header

Contents

Overview

The Enterprise Gateway can add HTTP headers to a message as it passes through a policy. It can also set a (Base64-encoded) value for the header.

For example, you can use the Add HTTP Header filter to add a message ID to an HTTP header. This message ID can then be forwarded to the destination Web Service, where messages can be indexed and tracked by their IDs. In this way, you can create a complete audit trail of the message from the time it is received by the Enterprise Gateway, until it is processed by the back-end system.

Each message being processed by the Enterprise Gateway is assigned a unique transaction ID, which is stored in the id message attribute. You can use the ${id} property to represent the value of the unique message ID. At runtime, this property is expanded to the value of the id message attribute.

Configuration

To configure the Add HTTP Header filter, perform the following steps:

  1. Enter an appropriate name for this filter in the Name field.
  2. Specify the name of the HTTP header to add in the HTTP Header Name field.
  3. Enter the value of the new HTTP header in the HTTP Header Value field. You can enter properties to represent message attributes. At runtime, the Enterprise Gateway expands these properties to the current value of the corresponding message attribute. For example, the ${id} property is replaced by the value of the current message ID. Properties have the following syntax:
    ${messsage_attribute}
  4. Select the Base64 Encode checkbox to Base64 encode the HTTP header value. For example, you should use this if the header value is an X.509 certificate.
  5. You can select whether to add the header to the message body or to the http.headers attribute using the appropriate radio button.