0

Good day!

I have soap response message that contatined binary zip file. It looks like: binary response

I try to parse zip-file:

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

ExecutionUtil.getDynamicProcessProperty("binary").getBytes(); - this row make byte[] from string which contain binary from soap response. When I try to test zipStream.getNextEntry() always return null.

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.

How I can get Entries from zipFile?

Rao
  • 20,781
  • 11
  • 57
  • 77
  • 2
    What you have in your image is not binary. It's text. And this text is most probably produced by base64-encoding the binary zip content. So you need to base64-decode it, and then open a zip input stream on the result. – JB Nizet Nov 20 '17 at 10:14
  • JB Nizet, Thanks, it works!! – skovoroda4 Nov 20 '17 at 10:47

0 Answers0