Sending a Referenced Attachment
Here’s the code for the method addDocument in the provided sample server implementation (located in the root directory of the MIME example), DocumentManagerPortTypeImp.cpp:
 
void
DocumentManagerPortTypeImp::addDocument(rwsf::CallInfo& callInfo,
const std::string& name_in,
const rwsf::MessageAttachment& document_in) // 1
{
documentMap_.insert(std::make_pair(name_in, document_in));
}
 
As line //1 shows, the referenced attachment generates the document parameter (labeled as document_in since it is an input parameter) as an rwsf::MessageAttachment instance. This rwsf::MessageAttachment object represents the whole part as a MIME attachment.
The method implementation simply adds the document to an internal data structure used by HydraExpress to hold state between service calls.