How Headers Work
Header support is primarily provided by the class
rwsf::CallInfo. In the client implementation, an
rwsf::CallInfo object is used to define additional header elements to be added to the request message. When the client sends the request, the additional header data is extracted from the
rwsf::CallInfo object and placed into SOAP and transport headers in the outgoing request message.
When the server parses the incoming SOAP message, it extracts any header data and places it into another
rwsf::CallInfo object. If there is a response, the server obtains the response header data from the
rwsf::CallInfo and places a properly formatted SOAP string into the SOAP response message.
HydraExpress parses and validates the format of the incoming SOAP header, returning a server error if the format is invalid. HydraExpress also guarantees correct formatting of the response SOAP header. No such validation occurs for transport headers. You must guarantee that the string representing header data is valid when adding it on the client or modifying it on the server.
The processing for transport header data is similar to that for SOAP headers: the incoming message is parsed for transport header data, which is placed in an
rwsf::CallInfo object, and the process is reversed to create a transport header for the response message.
If you create your own transport and you want that transport to support custom header elements, the transport code must know how to add and later consume these additional header elements. For more information on creating a transport, see
Chapter 11, Custom Transports and Listeners. For more information on creating a message handler, see
Chapter 14, SOAP Message Handlers.