NonStop SOAP User's Manual
Customizing the SOAP Server
NonStop SOAP User’s Manual—520501-012
8-44
Examples
Example 8-7. Sample Code Accessing Headers - I
// For example, we can set the output SOAP Headers in this method itself
UESoapHeaderManager * respMgr = env -> getRespHeaderMgr();
UESoapHeader *sampleHdr = respMgr -> createHeader
("myNS:testHeader","
urn:TestHeaderNameSpace");
sampleHdr -> setMustUnderstand(true);
sampleHdr -> setRole("http://www.w3.org/2002/06/soap-envelope/role/none");
string hdrVal = "<headersFound>";
hdrVal += count;
hdrVal += "</headersFound>";
sampleHdr -> setValue (hdrVal);
//set the attachment manager as the response AttachmentManager
bool success = env ' setRespHeaderMgr ( respMgr );
if(success){
gSoapTrace.log("Successfully set a SOAP Header for the response SOAP
Message");
}else{
gSoapTrace.log("Could not set the SOAP Header for the response SOAP
Message");
}
return 0;
}