Question

1
Replies
167
Views
EMELU839 Member since 2017 1 post
Rules Cube Inc.
Posted: 1 year ago
Last activity: 1 year 3 months ago
Closed

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

{
"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:dffdf@apache.org",
"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

...

F�@��X����?Ҧ��,A�I�OG��Vl�Z$�V�.��\U�ɱD��k��K�1+�ɿ���ek+=|����耝pb��9.h���������N�"�b��z�Y���&
oÔ���t����K���T�۬Wn�kKy�"ˊ�
�Ѝ��F�P��xڗ����gS�F*��O9LMVAg^�zD�.�ܮH���z�?���,�@Ѯͪ���ܕ����GhO�}e&�]|
endstream
endobj
2 0 obj
endobj
51 0 obj
xref
0000454612 00000 n
0000454319 00000 n
trailer
startxref
473660
%%EOF
--MIMEBoundary_fe424545454--
pyNote format:
LS1NSU1FQm91bmRhcnlfZDgyYWRkOWM0MDM5YzIyM2QwM2YyYmMyZmI0MGM5YTI3NmViODVlYjI3 NWVlZWZlDQpDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2pzb24NCg0KewogICJzdGF0dXMiOiAi dHJ1ZSIsCiAgInVuaXF1ZUlkIjogIkJGNjQtMjAxOTA2MjBUMjAwODU0LTYwM0dNVC0xNTYxMTc0
Data Integration
Moderation Team has archived post
Share this page LinkedIn