IBM BPM, V8.0.1, All platforms > Get started with IBM BPM > Key concepts > Bindings > Binding types > Web service bindings
Transport header propagation
When handling SOAP messages, you might need to access information from certain transport headers in messages that are received, ensure that messages with transport headers are sent with specific values, or allow transport headers to pass across a module.
When you configure a web service binding in Integration Designer, you can indicate that you want transport headers to be propagated.
- When requests are received at an export or responses are received at an import, the transport header information can be accessed, allowing logic in the module to be based on header values and allowing those headers to be modified.
- When responses are sent from an export or requests are sent from an import, transport headers can be included in those messages.
Specifying propagation of headers
To configure the propagation of transport headers for an import or export...
- From the Properties view of Integration Designer, select Binding > Propagation.
- Set the transport header propagation option that you require.
Transport header propagation is disabled by default and can be deployed only to a Version 7.0.0.3 (or later) runtime environment. Also note that, for Version 7.0.0.3, transport header propagation is limited to HTTP transport headers only.
If you enable propagation of transport headers, the headers will be propagated across a module from received messages and, if you do not explicitly remove the headers, the headers will be used in subsequent invocations in the same thread.
Transport headers cannot be propagated when you are using the web service (JAX-RPC) binding.
Access the header information
When transport header propagation is enabled for received messages, all transport headers (including customer-defined headers) are visible in the service message object (SMO). You can set the headers to different values or create new ones. If , however, that there is no checking or validation of the values you set, and any improper or incorrect headers might cause web service runtime problems.
Consider the following information about the setting of HTTP headers:
- Any changes to the headers that are reserved for the web service engine will not be honored in the outbound message.
For example, the HTTP version or method, Content-Type, Content-Length and SOAPAction headers are reserved for the web service engine.
- If the header value is a number, the number (rather than the string) should be set directly.
For example, use Max-Forwards = 5 (rather than Max-Forwards = Max-Forwards: 5) and Age = 300 (rather than Age = Age: 300).
- If the request message is less than 32 KB in size, the web service engine removes the Transfer-Encoding header and instead sets the Content-Length header to the fixed size of the message.
- The Content-language is reset by WAS.channel.http on the response path.
- An invalid setting for Upgrade results in a 500 error.
- The following headers append the value reserved by the web service engine to the customer settings:
- User-Agent
- Cache-Control
- Pragma
- Accept
- Connection
You can access the header information in one of the following ways:
- Using a mediation primitive to access the SMO structures
See the "Related Information" links to find information about using mediation primitives.
- Using the context service SPI
The following sample code reads the HTTP transport headers from the context service:
HeadersType headerType = ContextService.INSTANCE.getHeaders(); HTTPHeaderType httpHeaderType = headerType.getHTTPHeader(); List HTTPHeader httpHeaders = httpHeaderType.getHeader(); if(httpHeaders!=null){ for(HTTPHeader httpHeader: httpHeaders){ String httpHeadername = httpHeader.getName(); String httpHeaderValue = httpHeader.getValue(); } } List PropertyType properties = headerType.getProperties(); if(properties!=null){ for(PropertyType property: properties){ String propertyName = property.getName(); String propertyValue = property.getValue().toString(); } }
Troubleshooting
If you encounter problems when sending the revised headers, you can intercept the TCP/IP message by using tools such as the TCP/IP Monitor in Integration Designer. You access the TCP/IP Monitor by selecting Run/Debug > TCP/IP Monitor from the Preferences page.
You can also view the header values using the JAX-WS engine trace: org.apache.axis2.*=all: com.ibm.ws.websvcs.*=all:
Related concepts:
Protocol header propagation from non-SCA export bindings
Related information:
SMO: HTTP schema
HTTP Header Setter mediation primitive
Code to access binding-specific headers
Binding-specific headers in a Service Message Object (SMO)