Mapping Connect REST - receiving PDF file sent in the Body/Payload
Hi,
I'm trying to understand how to map a PDF file sent to the Connect REST in the Body/Payload. My understanding is the file is not encoded, it's just binary Java Object Type.
Here are some details from the headers of the message:
Content-Type: application/pdf
Transfer-Encoding: chunked
Content-Disposition: attachment; filename="xxx.pdf"
In Pega I tried this approach:
I'm using Java Object property type (BinaryPDF) to map the API response.
Then, I'm using the following Java step in the Activity:
This is partially working because it allows me to send the PDF to the browser:
Unfortunately, the pyResponseAttachmentPage in the Clipboard is empty therefore I cannot use the properties of the page to save the file to the repository and attach it to the Case Type.
Hi,
I'm trying to understand how to map a PDF file sent to the Connect REST in the Body/Payload. My understanding is the file is not encoded, it's just binary Java Object Type.
Here are some details from the headers of the message:
Content-Type: application/pdf
Transfer-Encoding: chunked
Content-Disposition: attachment; filename="xxx.pdf"
In Pega I tried this approach:
I'm using Java Object property type (BinaryPDF) to map the API response.
Then, I'm using the following Java step in the Activity:
This is partially working because it allows me to send the PDF to the browser:
Unfortunately, the pyResponseAttachmentPage in the Clipboard is empty therefore I cannot use the properties of the page to save the file to the repository and attach it to the Case Type.
Any ideas on how to solve it? Should I write a custom Java activity step to convert the binary Java Object type to String or Stream?
Thanks!