This documentation is for WSO2 Enterprise Integrator version 6.1.1 . View documentation for the latest release.

All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The parameters available to configure the Header mediator are as follows.

Paramater NameDescription
NameThe name of the header element. You can specify the namespace used in the header element by clicking the Namespaces link next to the text field.
ActionSelect Set if you want to set the header as a new header. Select Remove if you want to remove the header from the incoming message.
Value/ExpressionA static value or an XPath expression that will be executed on the message to set the header value.
Inline XML Header

This parameter allows you to directly input any XML syntax related to the Header mediator (specifically for SOAP headers). For example, to achieve the following configuration, you should enter the lastTradeTimestamp element in the Inline XML Header parameter.

Code Block
languagexml
<header>  
   <urn:lastTradeTimestamp xmlns:urn=" http://synapse.apache.org/ ">Mon May 13 13:52:17 IST 2013</urn:lastTradeTimestamp>  
</header>
 ScopeSelect Synapse if you want to manipulate SOAP headers. Select Transport if you want to manipulate HTTP headers.
 NamespacesYou can click this link to
add namespaces if
add namespaces if you are providing an expression. The Namespace Editor panel would appear. You can enter any number of namespace prefixes and URL that you have used in the XPath expression in this panel.
Info
titleNote

You can also configure the Mediator using XML. Click switch to source view in the Mediator window.

...

In the following example, the value for P1 code should be included in the SOAP header of the message sent from the client to the EI the ESB profile. To do this, the header mediator is added to the in sequence of the proxy configuration as shown below. 

...

The following example makes the EI add the the ESB profile add the HTTP header Accept with the value image/jpeg to the HTTP request made to the endpoint.

Code Block
languagehtml/xml
<in><inSequence>
    <header name="Accept" value="image/jpeg" scope="transport"/>
    <send>
        <endpoint name="people">
            <address uri="http://localhost:9763/people/eric+cooke" format="get"/>
        </endpoint>
    </send>
</in>inSequence>
<out><outSequence>
    <send/>
</out>outSequence>

If you have enabled wire logs, you will view the following output.

Code Block
languagetext
<< GET /people/eric+cooke HTTP/1.1
<< Accept: image/jpeg
<< Host: localhost:9763
<< Connection: Keep-Alive

Example 3 - Handling headers with complex XML

...