You are not logged in.
Pages: 1
What's is the best method of receiving files using SOA method, for example:
type
IInteractions = interface(IInvokable)
['{75775F98-DCD5-455A-A0EE-06E25FF24683}']
function SendEMail(const Subject, Plain, ToList: string; Attachments: ????) : TResponse;
end;
attachment should be a two fields structure like:
TAttachment = record
Name: RAWUtf8;
Value: RawByteString;
end;
Should I declare Attachments: ???? as Attachments: array of TAttachment or create a TCollection inherited class or ....?
Offline
check the documentation (16.8.6.1.1.5. Sending raw binary).
Last edited by pvn0 (2020-12-09 20:57:57)
Offline
OK, but where is an information how to declare the list of attachments (array or dynarray or collection)?
Offline
Yes you can use array of TAttachment, collections need to be registered for json serialization so you prob don't want that.
Whatever you use it's going to be converted and transmited as JSON, Value field or the entire record will be converted to Base64 text and sent as json text.
Last edited by pvn0 (2020-12-09 21:22:13)
Offline
Are you sure that I don't have to register record? Look at demo 37 , file ServFishShopTypes.pas
type
TFish = packed record
Name: RawUTF8;
Price: currency;
PictureURI: RawUTF8;
ID: variant;
end; // TSQLTable DynArraySave()
TFishList = array of TFish;
initialization
TJSONSerializer.RegisterCustomJSONSerializerFromText([
TypeInfo(TFish), _TFish,
TypeInfo(TFishDetailed), _TFishDetailed
])
Offline
Offline
Pages: 1