Please help I am having problem with correct encoding Clinical Document to base 64 and sending it to the Document object. Here is code I am using.
1.step I am encoding PDF file to Base64
byte[] bytes = System.IO.File.ReadAllBytes(pdffile);
return Convert.ToBase64String(bytes);
This string attached to Clinical documet
2.Attaching CDA document to Metadata submission request
byte[] bytes = System.IO.File.ReadAllBytes(CDADocument.xml);
string ReturnValue = Convert.ToBase64String(bytes);
byte[] newbyte = System.Text.Encoding.UTF8.GetBytes(ReturnValue);
doc[0].Value = newbyte;
Submission request passes all steps but decoding is not working. They are using Java API to decode the submission request. Thank you for your help
.Valueisbyte[], why not just give itbytesinstead of base-64 and utf-8?