[xsde-users] Q: Issue found with xml_schema::base64_binary

Rangarajan, Ravi_Sowmian raviraja at qti.qualcomm.com
Mon Sep 29 21:54:53 EDT 2014


Hi Boris.

When base64 encoding an MD5 of a file, following steps are followed. I have attached the FDT.xsd schema that is used to generate the reference code. Buffer md5 is a 16-byte buffer that contains MD5 of a file as binary and it needs to be sent as base64-encoded. I have verified computed MD5 is correct (as against reference info for that file) - however, base64md5 is showing up as "CXvk0ap1opO5qLQUh+hLAg==&#xA" in the final output, where first 24 chars of this string are correct while last four, i.e. &#xA are extra (MD5 should end with == in above example). I observed exact same extra chars in base64 encoded (via the xml constructor below) string of another base64_binary field in FDT.xsd. I am not sure if these chars mean something.

I am wondering if there is a known issue in computing a base64_binary field? And, how can I print such a field (base64md5) before invoking file.Content_MD5 API?

Thanks
Ravi
======================================
unsigned int transportObjectId = xxx;
std::string fileURI = "kkkk";

FDT::FileType file(XML_DELIMITER, fileURI, transportObjectId);
...
//--- size of md5 buffer is 16-bytes
xml_schema::base64_binary base64md5(md5, sizeof(md5)); 
file.Content_MD5(base64md5);
======================================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FDT.xsd
Type: text/xml
Size: 4421 bytes
Desc: FDT.xsd
Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20140930/0c328721/FDT.xml


More information about the xsde-users mailing list