【发布时间】:2014-01-17 06:13:38
【问题描述】:
请帮忙 我在将临床文档正确编码为 base 64 并将其发送到 Document 对象时遇到问题。 这是我正在使用的代码。
1.step 我正在将 PDF 文件编码为 Base64
byte[] bytes = System.IO.File.ReadAllBytes(pdffile);
return Convert.ToBase64String(bytes);
此字符串附加到临床文档
2.将CDA文档附加到元数据提交请求
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;
提交请求通过了所有步骤,但解码不起作用。 他们正在使用 Java API 来解码提交请求。 谢谢你的帮助
【问题讨论】:
-
什么是临床文件?
-
明显的问题...如果
.Value是byte[],为什么不直接给它bytes而不是base-64 和utf-8? -
我不能使用字节,因为我必须先编码为base64。Base64返回字符串但值参数需要字节
标签: c# java xml base64 document