Can anyone direct me as to how can a pdf document be added in an XML message. Meaning:
<pdfdata>…PDF file attached here </pdfdata>
In the above xml message I want the pdfData tag to hold the pdf file information. This file will be posted to a webservice which will extract the pdfData content, convert and save the pdf file locally. Can something like this be done using IS built-in services?
Any information is appreciated.
To carry binary data within an XML tag, the most convenient approach is Base 64 encoding the content (use pub.string:base64Encode):
I understand base64 encoding adds 37% to the message size than absolutely essential (since HTTP is an 8-bit transfer protocol). If size is a huge worry, you could try the methods below:
You could also embed binary data directly in the XML document using the CDATA tag. I haven’t tried that. This article describes it well:
Last month W3C put out a new standard on attaching binary data to XML documents:
It’s an unfortunate looking implementation full of namespaces. I bet WM doesn’t currently support it either, so you’ll have to write your own handler. I wouldn’t bother with it.