Rest provider Response attachement corrupted due to encoding

This Custom plugin script can be used to handle scenarios where rest response from WS provider contains attachment file(zip etc.) and it gets corrupted due to encoding. This can be implemented by a minor change in existing Process Flow design.

 

1. Create a New Custom Plugin activity using below script:

import org.apache.commons.io.IOUtils;
context.put("restResponse",IOUtils.toByteArray(inputStream));

2. Open the existing Process Flow.

3. Remove the existing Context target activity.

4. Use the Custom Plugin created in step 1 in place of Context target activity.

5. Save the Process Designer.

Have more questions? Submit a request

0 Comments

Article is closed for comments.