Skip to Content
0
Sep 07, 2020 at 11:26 AM

REST (sync) binary data - How to have real content-type in ABAP proxy

329 Views Last edit Sep 07, 2020 at 11:27 AM 2 rev

Dear all,

  • I have a ABAP proxy --> PI --> REST (synchronous) scenario, where the REST service provides an binary as a response (it would download to the client, when opening the endpoint with a browser).
  • The service provides either an *.eml file when calling it <endpoint host>/GetFile or an *.zip file when calling it <endpoint host>/GetZip. Let's concentrate on the Zip file for now.
  • I use rest receiver channel --> data format --> Binary --> Attachment to XI Message (No main payload)
  • I can see via Postman and via XPI inspector, that the service successfully provides the following HTTP header and PI storing them in Dynamic Configuration.
    11:35:53:833Guest~AP_http://sap.com/xi/XI/SystemCall]~.xi.ms.XIMessage.getMessageProperty⇦ with (MessagePropertyKey [propertyName=Content-Type, propertyNamespace=http://sap.com/xi/XI/System/REST])11:35:53:834Guest~AP_http://sap.com/xi/XI/SystemCall]~.xi.ms.XIMessage.getMessageProperty⇨ with application/zip
  • However, when the message is routed through PI the attachment within SXMB_MONI and ABAP Proxy has content-type "application/octet-stream".

My question

  1. While I could get the real content-type using ASMA / Dynamic Configuration I was wondering if there is a "native" way to tell PI to use the given content-type provided by the REST service.

Please note: I'm using an in-place Java mapping to generate the missing response payload as shown here: https://answers.sap.com/answers/13129963/view.html, however, since that only dummy-fills-in the main response payload I don't think it will matter for my current issue.

Many thanks

Cheers

Jens