SOAP and Transport Headers
HydraExpress provides full, generalized support for SOAP and transport headers. Of course, HydraExpress automatically processes any required headers, but HydraExpress also allows you to add any number of custom header elements.
*For SOAP, the client can add custom SOAP header elements to the request message, and when the message is received the server code captures all elements contained in the SOAP message <env:Header> element.
*For the HTTP and HTTPS transports shipped with HydraExpress, the client can add custom elements to the transport header, and when the message arrives, the custom elements in the transport header are captured. If you create your own transport, the transport code must include functionality to add and capture custom header data if you want this support.
On the client side, your client implementation code can add header elements to an rwsf::CallInfo object using the methods in its interface. The call to the client proxy service operation method passes in the rwsf::CallInfo object. The code that assembles the request message adds the SOAP header elements to the SOAP message header, and the transport header elements to the transport header.
On the server side, the code that handles the incoming message extracts the custom header elements from the transport and SOAP headers and places them into another rwsf::CallInfo object. This object is then passed through the message handler chain to the server implementation (which is itself a message handler). rwsf::CallInfo has a full interface for accessing and modifying the header data, and this interface can be used by any message handler in the chain.
If the message pattern requires a server response, any custom header elements that need to be returned to the client must be explicitly placed in the response rwsf::CallInfo object, usually by the server implementation code. This rwsf::CallInfo object then gets passed through the outgoing message handler chain. When the response message is assembled, the header elements are extracted from the rwsf::CallInfo object and placed in the SOAP and transport headers of the return message.