For one of our customers I had to integrate with the AFAS imageconnector endpoint /imageconnector/{imageId}?format={format}.
This endpoint returns in a json message with the image as a base64-encoded string property, in addition to the mimetype for the image:
/// Image Object
Class Mycustomer.Model.AfasGet.Image Extends (%SerialObject, %XML.Adaptor, %JSON.Adaptor)
{
/// file data (base64 encoded)
Property Filedata As %String(%JSONFIELDNAME = "filedata");
/// MimeType e.g. "image/jpeg"
Property MimeType As %String(%JSONFIELDNAME = "mimetype");
}
In the Message class, we tried handling this like: