The responses DataPower gets from the backend should be the same response the invoker receives. What happened is, since I have an xformbin action which transformed the response payload to text, the Content-Type was transformed into text/plain automatically. To solve this, I added a few lines in the last xform action in my proceasing rule which retrieves the original content type via
var://context/INPUT/content-type
.My original intent was to set this variable in the first xformbin action so that I will retrieve it later in tha last xform action. But, when I tested it, I was surprised to see that I have successfully reassigned the original Content-Type already.
Here's a segment of the last xform:
<xsl:variable name="content_type" select="dp:variable('var://context/INPUT/content-type')" /> <dp:set-http-response-header name="'Content-Type'" value="$content_type" />DISCLAIMER: I'm no expert in DataPower. In fact, it's just a recently acquired skill that is a few months old so please bare with me if my solutions seem stupid.
No comments:
Post a Comment