Question

510
Views
Giuseppe Acuto (Giuseppe)
Knowledge Expert SA

Knowledge Expert SA
FR
Giuseppe Member since 2018 6 posts
Knowledge Expert SA
Posted: June 18, 2019
Last activity: June 18, 2019
Posted: 18 Jun 2019 10:46 EDT
Last activity: 18 Jun 2019 10:46 EDT
Closed

How to decode a Zip file from a REST GET response

Hello,

My application has to call an external REST service with Basic Authentication in order to retrieve and download a zip file (byte array) containing a set of files. The response is a simple byte array, not a json. The goal is to provide to the user a button to download that specific file. Since the service is available only on client specific network and only Pega has the access, first the zip file has to be downloaded in Pega and then to be made available to the final user.

I created a simple REST connector and mapped the response on a property of Text Type giving me the byte array as raw string. When I call the connector from a data page the response is displayed as it's shown in the attachment. If I tried to map the response on a Java Object of class java.io.ByteArrayOutputStream but I don’t receive anything in this case.

  1. What is the best way to map the response?
  2. How the response can be manipulated/decoded in Pega and make it available when the user click on a the button?
Enterprise Application Development Dev/Designer Studio Data Integration Java and Activities
Moderation Team has archived post, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.