cancel
Showing results for 
Search instead for 
Did you mean: 

REST Adapter with Attchments

Former Member
0 Kudos

Hello everyone! We have to create a REST service that will accept HTTP GET calls and will retrieve PDF files to the REST client! How can I attach PDF files to the JSON response? Is that possible?

Thanks in advance

Julio

Accepted Solutions (1)

Accepted Solutions (1)

engswee
Active Contributor
0 Kudos

Hi Julio

Do you mean you need to provide both a JSON response together with a PDF file?

From the online help details, it looks like attachments are not supported by the REST adapter.

REST Adapter Overview - Advanced Adapter Engine - SAP Library

Maybe you can change the design and have two services instead - after all RESTful services are supposed to be simple

1) provide JSON response

2) provide PDF file

Rgds

Eng Swee

Former Member
0 Kudos

Hi Eng Swee! Actually, providing the PDF would be enough for me! The problem is that the REST adapter will always add "{" to the response message! We need only the raw data!

engswee
Active Contributor
0 Kudos

Hi Julio

I don't have the SAP REST adapter on my system, so I can't test it out, but can you try to specify the Response Format as XML in the sender channel to see if it adds the { to the response?

Not sure how you are retrieving the PDF file on your receiver side, but if it's an attachment from the receiver channel, then you can try to swap it into the main payload either with a Java mapping or PayloadSwapBean.

Rgds

Eng Swee

Answers (1)

Answers (1)

0 Kudos

Hi Julio,

Do you found the solution? I have a requirement, HTTP GET calls and will retrieve PDF files from the client.

Please help.

Regards,Sirius.