Server-Side Code
On the server side, the implementation HeadersImp.cpp retrieves the header data and adds a new header to the response message whose data is a modified version of the data in the request message header.
 
int HeadersImp::addHeaders(rwsf::CallInfo& info, int in1_in, )
{
std::string headerValue = //1
info.getRequestSoapHeaderValue(rwsf::XmlName("MyHeader",
rwsf::XmlNamespace("headers",
"http://www.roguewave.com/examples/webservice/headers")));
 
info.addResponseSoapHeader(rwsf::XmlName("ServerHeader", //2
rwsf::XmlNamespace("headers",
"http://www.roguewave.com/examples/webservice/headers")),
headerValue + ": From the server");
 
return in1_in;
}
//1 Retrieves the header data into the variable headerValue.
//2 Adds a response SOAP header element named ServerHeader, in a namespace with the prefix headers, whose value is the request header data with the literal string ": From the server" appended.