Call Custom Service with JSON Body in D365FO
Call Custom Service with JSON Body in D365FO
FileUploadTemporaryStorageResult fileUpload = File::GetFileFromUser() as FileUploadTemporaryStorageResult;
System.IO.Stream stream = fileUpload.openResult();
str responceJson;
using (var reader = new System.IO.StreamReader(stream))
{
responceJson = reader.ReadToEnd();
TESTPOReceiptRequestContract contract = FormJsonSerializer::deserializeObject(
classnum(TESTPOReceiptRequestContract), responceJson);
new TESTPOReceiptService().processRecord(contract);
}
*This post is locked for comments