cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

HTTPS Sender - How to access zip file sent as body - in Groovy script ?

jose_augastine3
Active Participant
1,264

HTTPS Sender Adapter

How to access the zip file sent in the body of HTTP (POST, GET or PUT) request in Groovy Script ?

I mean how to access zip file in Groovy Script ?

Thanks in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

r_herrmann
Active Contributor
0 Likes

Hi Jose,

have you tried to read the body as byte array? (The success of this method depends of the way the sender sends/posts the data, but in general this should work.)

byte [] bytes = message.getBody(byte[].class)
jose_augastine3
Active Participant
0 Likes

Hi Raffael,

I was able to unzip file. Not able to read the same. Could you please help ?

I am getting xml and pdf file in zip file, which is unzipped.

def byte[] bytes = message.getBody(byte[].class)

def zipEntries = extractZipEntries(bytes)

Now how to read both files ?

How to pass entry name to readEntryFromZipAsString(...) ?

Thanks in adavance,

r_herrmann
Active Contributor
0 Likes

Hi Jose,

I answered your below your other question. Because this question was about getting the payload as bytes and not about unzipping. If my answer helped to solve your problem, don't forget the answer as "accepted answer".

Regards