HTTP headers
HTTP import and export bindings allow configuration of HTTP headers and their values to be used for outbound messages. The HTTP import uses these headers for requests, and the HTTP export uses them for responses.
Statically configured headers and control information take precedence over values dynamically set at run time. However, the dynamic override URL, Version, and Method control values override the static values, which are otherwise considered defaults.
- For Endpoint Reference, use com.ibm.websphere.sca.addressing.EndpointReference APIs or set the /headers/SMOHeader/Target/address field in the SMO header.
- For Dynamic Override URL, Version, and Method, use the HTTP control parameters section of the Service Component Architecture (SCA) message. Note that the Dynamic Override URL takes precedence over the target Endpoint Reference; however, the Endpoint Reference applies across bindings, so it is the preferred approach and should be used where possible.
The control and header information for outbound messages under HTTP export and import bindings is processed in the following order:
- Header and control information excluding HTTP dynamic override URL, Version, and Method from the SCA Message (lowest priority)
- Changes from the administrative console on the export/import level
- Changes from the administrative console on the method level of the export or import
- Target address specified by way of the Endpoint Reference or the SMO header
- Dynamic Override URL, Version, and Method from the SCA message
- Headers and control information from the data handler or data binding (highest priority)
The context service is responsible for propagating the context (including the protocol headers, such as the HTTP header, and the user context, such as account ID) along an SCA invocation path. During development in IBM Integration Designer, you can control the propagation of context by way of import and export properties. For more details, see the import and export bindings information in the IBM Integration Designer information center.
Supplied HTTP header structures and support
Table 1 itemizes the request/response parameters for HTTP Import and HTTP Export requests and responses.
Control name | HTTP Import request | HTTP Import response | HTTP Export request | HTTP Export response |
---|---|---|---|---|
URL | Ignored | Not set | Read from the request message. Note: Query string
is also part of the URL control parameter.
|
Ignored |
Version (possible values: 1.0, 1.1; default is 1.1) | Ignored | Not set | Read from the request message | Ignored |
Method | Ignored | Not set | Read from the request message | Ignored |
Dynamic Override URL | If set in the data handler or data binding,
overrides the HTTP Import URL. Written to the message in the request
line. Note: Query string is also part of the URL control parameter.
|
Not set | Not set | Ignored |
Dynamic Override Version | If set, overrides the HTTP Import Version. Written to the message in the request line. | Not set | Not set | Ignored |
Dynamic Override Method | If set, overrides the HTTP Import Method. Written to the message in the request line. | Not set | Not set | Ignored |
Media Type (This control parameter carries part of the value of the Content-Type HTTP header.) | If present, written to the message as part of
the Content-Type header. Note: This control element value should be
provided by the data handler or data binding.
|
Read from the response message, Content-Type header | Read from the request message, Content-Type header | If present, written to the message as part of
Content-Type header. Note: This control element value should be provided
by the data handler or data binding.
|
Character set (default: UTF-8) | If present, written to the message as part of
the Content-Type header. Note: This control element value should be
provided by the data binding.
|
Read from the response message, Content-Type header | Read from the request message, Content-Type header | Supported; written to the message as part of
the Content-Type header. Note: This control element value should be
provided by the data binding.
|
Transfer Encoding (Possible values: chunked, identity; default is identity) | If present, written to the message as a header and controls how the message transformation is encoded. | Read from the response message | Read from the request message | If present, written to the message as a header and controls how the message transformation is encoded. |
Content Encoding (Possible values: gzip, x-gzip, deflate, identity; default is identity) | If present, written to the message as a header and controls how the payload is encoded. | Read from the response message | Read from the request message | If present, written to the message as a header and controls how the payload is encoded. |
Content-Length | Ignored | Read from the response message | Read from the request message | Ignored |
StatusCode (default: 200) | Not supported | Read from the response message | Not supported | If present, written to the message in the response line |
ReasonPhrase (default: OK) | Not supported | Read from the response message | Not supported | Control value ignored. The message response line value is generated from the StatusCode. |
Authentication (contains multiple properties) | If present, used to construct the Basic Authentication
header. Note: The value for this header will be encoded only on the
HTTP protocol. In the SCA, it will be decoded and passed as clear
text.
|
Not applicable | Read from the request message Basic Authentication
header. The presence of this header does not indicate the user has
been authenticated. Authentication should be controlled in the servlet
configuration. Note: The value for this header will be encoded only
on the HTTP protocol. In the SCA, it will be decoded and passed as
clear text.
|
Not applicable |
Proxy (contains multiple properties: Host, Port, Authentication) | If present, used to establish connection through proxy. | Not applicable | Not applicable | Not applicable |
SSL (contains multiple properties: Keystore, Keystore Password, Trustore, Trustore Password, ClientAuth) | If populated and the destination url is HTTPS, it is used to establish a connection through SSL. | Not applicable | Not applicable | Not applicable |