Mapping multi format REST response into PDF format
Hi,
I am receiving the following response from the REST service. The response contain two different format(json and PDF-Binary) at the same time. I want to map the PDF part into response. The solutions I applied;
- I tried to give 2 different headers in the Connect-REST/Methods, since the two different formats are separated with the tags "Content-Type: application/json" and "Content-Type: application/pdf" in the response , that throws exception.
-I tried to give one the header as "Content-Type: multipart/related" for two different formatting, not successful mapping.
- In order to get the whole response and split the required part, I tried to save the whole content in .pyNote however Pega saves the content (appears to be) in BLOB format.
My question is does Pega support mapping the response in two different formatting? Or is there a workaround in my case?
The sample response:
--MIMEBoundary_fe424545454
Content-Type: application/json
Hi,
I am receiving the following response from the REST service. The response contain two different format(json and PDF-Binary) at the same time. I want to map the PDF part into response. The solutions I applied;
- I tried to give 2 different headers in the Connect-REST/Methods, since the two different formats are separated with the tags "Content-Type: application/json" and "Content-Type: application/pdf" in the response , that throws exception.
-I tried to give one the header as "Content-Type: multipart/related" for two different formatting, not successful mapping.
- In order to get the whole response and split the required part, I tried to save the whole content in .pyNote however Pega saves the content (appears to be) in BLOB format.
My question is does Pega support mapping the response in two different formatting? Or is there a workaround in my case?
The sample response:
--MIMEBoundary_fe424545454
Content-Type: application/json
{
"status": "true",
"uniqueId": "BF64-3434-371GMT-4343",
"respTimestamp": "2019-06-20T15:55:25.644-04:00",
"retrieveContentResponse": {
"auditInformation": [
{
"identifier": "trt",
"value": "34343"
}
],
"businessUnitCode": "ret",
"report": [
{
"identifier": "erdczcsc2323",
"mimeType": "application/pdf",
"binaryDataHref": "cidd: Proprietary information hidden",
"reportType": "DFEWREWR",
}
]
}
}
--MIMEBoundary_fe424545454
Content-Type: application/pdf
%PDF-1.2
%������
1 0 obj
<<
/Author (Pro API)
/CreationDate (D:44)
/ModDate (D:44)
/Creator (PRO HLCAPI)
/Title (PRO Document)
/Producer (CrawfordTech PDF Driver Version 4.8 64 Bit Build ID 6205 on January 13, 2019 at 19:55:47)
/Subject ()
>>
endobj
5 0 obj
<</Length 1831 /Filter /FlateDecode >>
stream
...