Somtimes you may want to know what "binary" or Non-XML data is in INPUT context or at any other context in a flow.
This posting contained utility dump-nodes.xsl which allowed to dump the (binary) data base64 encoded into a temporary: folder file:
Today's developerWorks DataPower forum thread "how to Capture Binary data in a file or log?" asked to get the data into the log instead:
https://www.ibm.com/developerworks/forums/thread.jspa?threadID=453420
https://www.ibm.com/developerworks/forums/thread.jspa?threadID=453420
That is fine for small messages, see technote
"DataPower log event message truncated when using xsl:message to output a custom log message"
http://www-01.ibm.com/support/docview.wss?uid=swg21447824
"DataPower log event message truncated when using xsl:message to output a custom log message"
http://www-01.ibm.com/support/docview.wss?uid=swg21447824
To be able to directly "read" the binary data logged and my "brain-base64-decoder" not being that good stylesheet
log-binary.xsl logs the binary data hexadecimally encoded (50% message length increase compared to base64-encoded).
log-binary.xsl logs the binary data hexadecimally encoded (50% message length increase compared to base64-encoded).
See this little demonstration:
This is the log entry from my box "dp3-l3.boeblingen.de.ibm.com":
And this is stylesheet log-binary.xsl which returns the (binary) input unchanged, allowing to plug this in wherever needed:
$ echo -n "test" | coproc2 log-binary.xsl - http://dp3-l3:2224 -s | od -tcx1 |