This topic explains how to configure and apply the Header Data Bank tool that extracts headers from one message and makes them available as parameters in another.
Sections include:
Understanding Header Data Bank
The Header Data Bank tool enables you to extract values from HTTP and JMS headers from one place and use those values in another place.
The Header Data Bank enables you to:
- Use a header value from the SOAP response of Tool 1 as a parameter in the SOAP request of Tool 2.
- Take a value from the header of an incoming request and use it to set a value in the response.
Configuring Header Data Bank
To configure the Header Data Bank tool:
Ensure that you have a test suite or set with at least two tools.
Right-click the node for the tool associated with the data you want to extract (for example, if you want to extract a value from an incoming request or outgoing response, choose the Message Responder that handles those messages), then choose Add Output.
In the Add Output wizard, indicate where you want to extract the value from (for example, Response or Request Transport Header) and click Finish. A Transport Header > Header Data Bank node appears in the Tool 1 branch.
- Double-click the Transport Header > Header Data Bank node. The following Header Data Bank operations appear in the right GUI panel.
- Name: Specifies the name of the Data Bank tool.
Available Headers: Specifies the headers available in the HTTP or JMS traffic. This field is blank after first adding the Header Data Bank node to the tool.The Available Headers will be automatically filled after the test suite is run.
Extract/Alter tabs: Specifies the headers you would like to extract or alter for use in another message. You can extract a header through the Extract tab and you can alter a header through the Alter tab.
- If using the tool in Virtualize, click Add Header to add a default header. You can select the values added to these columns and click Modify to change the default header name.
If using the tool in SOAtest, right-click the main test suite tree node and select the Test Using ’Example Configuration to initialize the Header Data Bank and verify the available headers.
To extract a header, select the Extract tab and complete one of the following:
- To extract a header from the Available Headers, select a header from the Available Headers view and click Add Header.
After selecting a header, it is added to the Selected Headers list in the Extract tab. The Selected Headers list consists of the following columns:- Header: Displays the selected Header name. To edit a selected Header, double-click the desired Header in the Header column and edit the Header text.
Custom column name: Specifies the name of the data source column in which to store the value. Values are stored in an internal data source unless you specify otherwise (for example, if you select Writable datasourcecolumn or Variable). This is the name you will use to reference the value in other places. So, if it is stored in a data source column named MyValue, you would choose MyValue as the parameterized value. You could also reference it as
${My Value}
in literal or multiple response views.Write to all columns that match: Enables storing the value in all columns whose name contains the given string. When extracting multiple values from a message, each value will be written across all the columns that match. In contrast, if you pick a single writable data source column (the above option), then the values will be written down the column across multiple rows.
Variable: Enables saving the value in the specified variable so it can be reused across the current test suite (SOAtest) Responder suite or Action suite (Virtualize). The variable must already be added to the current test suite as described in Defining Variables in SOAtest or Responder suite or Action suite as described in Defining Variables in Virtualize. Any values set in this manner will override any local variable values specified in the suite properties panel.
To extract a Header that is not in the Available Headers, click Add Header. A new Header will be added to the Selected Headers list in the Extract tab. Select the header and click Modify to change the default header to the header name you want to extract.
- To extract a header from the Available Headers, select a header from the Available Headers view and click Add Header.
To alter a Header, select the Alter tab and complete one of the following:
To alter a Header from the Available Headers, select a node from the Available Headers view and click Add Selected Nodes.
After selecting a header, it is added to the Selected Headers list in the Alter tab. The Selected Headers list consists of the following columns:Header: Displays the selected Header name. To edit a selected Header, double-click the desired Header in the Header column and edit the Header text.
Data Source column name: Data Source column names of Selected Headers will display as parameterized values in the tool panel, meaning that you will be able to use these Selected Elements in another tool to send as part of the message.
To alter a Header that is not in the Available Headers, click Add Header. A new Header will be added to the Selected Headers list in the Alter tab. Select the header and click Modify to change the default header name.
Using the Extracted Value
After adding and/or modifying the extraction, configure the header values and properties (in the Headers tab) that you want to use the extracted data.
Set the value to Parameterized and choose the appropriate item from the menu. For example, if you saved the value to the "MyVariable" variable, you would select it as follows.
Viewing the Data Bank Variables Used During Test Execution
You can configure the Console view (Window > Show View > Console) to display the data bank variables used during test execution. For details, see Monitoring Variable Usage.