AnsweredAssumed Answered

UnZIP byte[] from soap message and upsert files to SuccessFactors

Question asked by e.pavlov353333 on Nov 16, 2017
Latest reply on Dec 27, 2017 by jm477572

Good day!

 

I have SOAP service that has response with zip-file (binary) that contains number of pdf files. I need to unzip this file and save pdf files separetely for different SuccessFactors Odata entities.

Response of SOAP service looks like:

After soap call I put binary from response to dpp.

After this I try to use Data process shape for unzip file and parse pdf files. 

Groovy code:

Logger logger = ExecutionUtil.getBaseLogger();
byte[] bin = ExecutionUtil.getDynamicProcessProperty("binary").getBytes();
logger.warning("binary "+bin);
ZipInputStream zipStream = new ZipInputStream(new ByteArrayInputStream(bin));
logger.warning("zipStream "+zipStream+" nextEntry "+zipStream.getNextEntry());

 

In test mode nextEntry always null but zipStream always exist.

I try to make

byte [] byteZip= child.getText().getBytes("UTF-8");

ZipInputStream zipStream = new ZipInputStream(newByteArrayInputStream(byteZip) or .Charset.forName("UTF-8")) 

but I always have same result.

 

So i have next question:

1.How i can unzip file and get it entries in groovy?

2. How i can set content of, for example, Attachment entities if content field must be base64 encoded?

Outcomes