Original Message:
Sent: Thu March 20, 2025 09:08 AM
From: Hermann Stamm-Wilbrandt
Subject: How to decode response content type as application/zip?
That is a second "by hand" way of dealing with "gzip"ed backend response.
You don't need to use "dp:inflate()" when you set "Compression" to "on" as I showed in my previous posting.
Then DataPower will do the inflate and your service will get inflated data as input.
------------------------------
Hermann Stamm-Wilbrandt
Compiler Level 3 support, IBM DataPower Gateways
IBM
Boeblingen
Original Message:
Sent: Thu March 20, 2025 08:48 AM
From: Mahender Batta
Subject: How to decode response content type as application/zip?
Dear @Hermann Stamm-Wilbrandt,
Thank you so much!
I'm able to achieve it by dp:inflate DataPower extension and below is my XSLT code:
<xsl:variable name="response"> <dp:url-open target="{$url}" response="responsecode-binary" content-type="text/xml" http-method="POST" ssl-proxy="client:cert"> <xsl:copy-of select="dp:parse($inputxml)"/> </dp:url-open> </xsl:variable> <xsl:variable name="resultXml"> <xsl:copy-of select="dp:parse(dp:inflate(dp:binary-encode($response/result/binary/node()),'gzip'))"/> </xsl:variable>
------------------------------
Mahender Batta
Original Message:
Sent: Thu March 20, 2025 06:17 AM
From: Hermann Stamm-Wilbrandt
Subject: How to decode response content type as application/zip?
That is a completely different story, in initial posting you wrote "application/zip" which is wrong for gzip as in your code, should be "application/gzip".
For that you just need to enable "Compression" for MultiProtocolGateway:

------------------------------
Hermann Stamm-Wilbrandt
Compiler Level 3 support, IBM DataPower Gateways
IBM
Boeblingen
Original Message:
Sent: Thu March 20, 2025 05:42 AM
From: Mahender Batta
Subject: How to decode response content type as application/zip?
Dear @Joseph Morgan,
Thank you for your response, Yes it just compressed for network speed. Backend team had provided some java sample code to read/decode it. However it is not relevant but to get some idea I'm posting below,
InputStream gzipStream = new GZIPInputStream(backendResponseStream); Reader decoder = new InputStreamReader(gzipStream, "UTF-8"); BufferedReader bufferServerReader = new BufferedReader(decoder);
Now, my requirement is to o it DataPower gateway, decode the response and return as JSON.
------------------------------
Mahender Batta
Original Message:
Sent: Wed March 19, 2025 09:32 AM
From: Joseph Morgan
Subject: How to decode response content type as application/zip?
Is it just compressed for network speed or is the back end explicitly compressing as an attachment or other means?
Check to see if your "Enable pass through of compressed payload" is "on". If so, you won't be able to process it.
Also check your User Agent Allow Compression Policy, as it might affect such things.
------------------------------
Joseph Morgan
CEO - Independent
Original Message:
Sent: Wed March 19, 2025 04:20 AM
From: Mahender Batta
Subject: How to decode response content type as application/zip?
Dear All,
I have a scenario where the server response is in the application/zip
format. Could you please advise on how to read and extract the data from it?
Any suggestions using GatewayScript or XSLT would be greatly appreciated.
Thanks!
------------------------------
Mahender Batta
------------------------------