Topic
2 replies Latest Post - ‏2012-11-05T12:29:35Z by SystemAdmin
SystemAdmin
SystemAdmin
6772 Posts
ACCEPTED ANSWER

Pinned topic Download file over http through Datapower and MQ

‏2012-10-29T09:50:40Z |
I'm trying to download file through following schema:

Client <-> DP_int <-> MQ_int <-> MQ_ext <-> DP_ext <-> Endpoint

When sending request, I put headers and params into xml inside xslt (DP_int), pass it througt MQ, then set headers and params and send it to the endpoint (DP_ext).

When processing response, I use binary xslt transform with simple ffd for input-mapping:

<?xml verison="1.0" encoding="UTF-8"?>
<File name="input">
<Field name="body"/>
</File>

If it's a text file everything is fine. Response body passed correctly into xml, but if it's a binary file, only beginning of the body (up to the first zero byte) passed into xml.

My xslt:

...
<dp:input-mapping href="local:///my.ffd"/>
<xsl:template match="/">
...
<xsl:variable name="body">
<xsl:value-of select="input/body"/>
<xsl:variable>

<xsl:element name="body">
<xsl:copy-of select="$body"/> <!-- 1 -->
<!-- <xsl:copy-of select="dp:binary-encode($body)"/> 2 -->
<!-- <xsl:copy-of select="dp:radix-convert($body, 16, 64)"/> 3 -->
</xsl:element>
</xsl:template>
...

1. only beginning of the body (up to the first zero byte) passed into xml
2. only beginning of the body (up to the first zero byte) passed into xml
3. Invalid character for input '16' string passed into xml
Updated on 2012-11-05T12:29:35Z at 2012-11-05T12:29:35Z by SystemAdmin