Reading the SOAP Headers of a service within the service context

The SOAP headers are read from the service context via the operation getSOAPHeaders(). The operation returns an array of SOAPHeaderElements. The result can then be read and processed.

The following example reads the SOAP headers from the service context and reads the header array into the object soapHeaderArray for further parsing (xmlToClass()):

If a header element CorrelationID contains a correlation ID (e.g. set by the SOAP adapter),  it will be logged to the transaction log (see Contents of the Transaction Log).

Setting the SOAP Headers of a service within the service context

The E2E Bridge is capable of creating custom SOAP headers elements with a build-in function setSOAPHeaders(). The function is called within the service context and needs an array of SOAPHeaderElement objects as an input. The following example shows how to create a simple SOAP header block and set it to the services context.