Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Connect-REST fails to map response binary stream



User is on Pega 7.1.7 and is using the Connect-REST to get a binary stream as response. The response body is having a file binary data, which can be pdf, xlsx etc. While mapping the response body which is a binary stream to a Java object on clipboard they are getting the below exception: Could not write response entitiy to output stream

Error Messages

Caused by: Attempted read from closed stream.
at com.pega.apache.http.entity.BasicHttpEntity.writeTo(
at com.pega.apache.http.entity.HttpEntityWrapper.writeTo(
at com.pega.apache.http.conn.BasicManagedEntity.writeTo(
at com.pega.pegarules.integration.engine.internal.connect.http.HTTPClient.getReponseData(
... 69 more

Steps to Reproduce

  1. Create a REST service to return a binary file.
  2. Create a REST Connector in a Pega application to consume the binary response and map it to a Java object on clipboard. 
  3. Create a Data Page or Activity to run the connector.
  4. The mapping error occurs while running the connector.

Root Cause

A defect in Pegasystems’ code or rules is identified as the root cause of this issue.


Apply HFix-27327.


Published April 29, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us