Retrieving a Referenced Attachment
The GetDocuments method illustrates client-side working with unreferenced attachments. If the WSDL described another operation called getDocument which accessed a referenced attachment it might look like this:
<operation name="GetDocument">
<soap:operation soapAction="getdocument"/>
<input>
<soap:body use="literal"
namespace="http://www.roguewave.com/rwsf/webservice/examples"/>
</input>
<output>
<mime:multipartRelated>
<mime:part>
<soap:body use="literal"
namespace="http://www.roguewave.com/rwsf/webservice/examples"/>
</mime:part>
<mime:part>
<mime:content part="document" type="*/*"/>
</mime:part>
</mime:multipartRelated>
</output>
</operation>
This
getDocument service operation would take a
documentKey as input and return the full attachment in the part called
document. The generated
getDocument service operation method would return the part as an
rwsf::MessageAttachment instance.
So we could write the invoke_getDocument() client implementation code to look like:
void invoke_getDocument(DocumentManagerBindingProxy& proxy)
{
std::string documentKey_in = "whatever";
rwsf::MessageAttachment document_out;
rwsf::CallInfo callInfo;
document_out = proxy.getDocument(callInfo, documentKey_in);
std::string contentType = document_out.getContentType();
std::string image = document_out.getPayload();
...
}