04-09-2010 3:22 PM
Hi,
what would be the best way to add a MIME object to XML?
I am reading the MIME object with class CL_MIME_REPOSITORY_API. I am unsure how to get the XSTRING into a suitable XML format.
Thanks.
/Björn-Henrik
04-09-2010 10:00 PM
If MIME object is a binary, it's usually stored in base 64 (please search forum with this term), and if it's a text, it is usually stored as text in UTF-8 encoding but it may be UTF-16 for Asian or some rare languages. In fact, it depends on the DTD or XSD that defines your XML structure.
04-10-2010 11:12 AM
Hi Sandra,
thanks for your reply, it helped me solve the issue. Here is how I solved it for MIME images
1. Get XSTRING of MIME image
2. SCMS_XSTRING_TO_BINARY
3. SCMS_BINARY_TO_STRING
4. cl_http_utility=>if_http_utility~encode_base64
/Björn-Henrik
04-10-2010 12:50 PM
04-10-2010 1:10 PM
Hi again,
I just found function module SCMS_BASE64_ENCODE_STR, which makes it even easier:
1) Get MIME XSTRING using class CL_MIME_REPOSITORY_API
2) Convert XSTRING with function module SCMS_BASE64_ENCODE_STR
/Björn-Henrik