How to access HTTP headers while exposing or invoking WEB Services in BusinessWorks 6.X and BusinessWorks Container Edition

While exposing or invoking WEB Services it is in some cases needed to access standard or custom HTTP headers. In BusinessWorks 5.X there was no other solution than developing an HTTP Proxy but this is no longer the case in BusinessWorks 6.X and BusinessWorks Container Edition.

To get or set HTTP headers while exposing or calling WEB Services you have to do the following:

Create an XML schema to manage your context

Using the tool of your choice create an XML schema containing the elements you want to use to set or get HTTP header values.

Example of a context Schema

Define the context in the BusinessWorks process exposing or invoking the WEB Service

Depending on what you want to do select the Component or the Reference that needs HTTP headers to be accessed.

Open the Context tab and set the Input Context or Output Context or both as needed.

Example of defining a context on a reference

Note : it is possible to use the same context for all operations or a specific context for each operation (click on the yellow pencil icon for this).

Set or Get the context in the BusinessWorks process

Add a Set Context or Get Context activity, or both, in the process and map inputs has needed.

Example of Set Context and Get Context activity

Map the header fields in the SOAP Service Bindings

Then select the Component corresponding to the target process Component or Reference and open the ‘Bindings’ tab and map the Headers using the Request Context or map the Response Context using the Headers or both as needed.

Example of mapping the custom Header field in a request

Note that it is possible to access standard HTTP Headers and also custom HTTP Headers as shown in the example above.

I work as an Architect at TIBCO on Integration products. Opinions here are my own.