Downloading excel file is corrupted from REST call

0
Hi, I am trying to download an excel file from a REST call.. the file is downloading correctly but when opened in Excel it is throwing an error saying the file is corrupted. I tested the service through SOAP UI and the file is downloading correctly.  The same service in Mendix is downloading PDF files properly.. I am able to open the pdf files and view content. Is there any special care that we need to take in case of Excel files..?   When I try to check the response through trace.. below is sample response:   HTTP/1.1 200 OK X-Backside-Transport: OK OK,OK OK Connection: Keep-Alive Transfer-Encoding: chunked X-Powered-By: Servlet/3.0 Content-Language: en-US Date: Mon, 16 Jan 2023 20:38:12 GMT X-Global-Transaction-ID: bda678a963c5b5b4081c8812 Content-type: multipart/related; boundary="MIMEBoundary_b45b4fd6eee14d9713da7c60f992615a7700515807a4ee9f"; start-info="text/xml"; type="application/json"; start="<0.445b4fd6eee14d9713da7c60f992615a7700515807a4ee9f@apache.org>" Access-Control-Expose-Headers: APIm-Debug-Trans-Id, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Global-Transaction-ID Access-Control-Allow-Origin: * Access-Control-Allow-Methods: POST X-RateLimit-Limit: name=rate-limit-1,350000; X-RateLimit-Remaining: name=rate-limit-1,349981; --MIMEBoundary_b45b4fd6eee14d9713da7c60f992615a7700515807a4ee9f Content-Type: application/json Content-Transfer-Encoding: binary Content-ID: <0.445b4fd6eee14d9713da7c60f992615a7700515807a4ee9f@apache.org> { "Response":{ "responseHeader":{ "responseId":"_379Rs", "refidRequest":"_379", "cmdStatus":"Success", "cmdCode":"EIG-000", "message":"Have a nice day!" }, "documents":{ "document":[ { "documentName":"Sample.xlsx", "contentId":"cid:545b4fd6eee14d9713da7c60f992615a7700515807a4ee9f@apache.org" } ] } } } --MIMEBoundary_b45b4fd6eee14d9713da7c60f992615a7700515807a4ee9f Content-Type: application/octet-stream Content-Transfer-Encoding: binary Content-ID: <545b4fd6eee14d9713da7c60f992615a7700515807a4ee9f@apache.org> PK!b�h^�[Content_Types].xml �(����N�0E�H�C�-Jܲ@5��*Q>�ēƪc[�ii����B�j7���{2��h�nm���ƻR ����U^7/���%��rZY�@1__�f��q��R4D�AJ�h>����V�ƹ �Z�9����NV�8ʩ����ji){^��-I�"{�v^�P!XS)bR�r��K�s(�3�`c�0��������7M4�����ZƐk+�|\|z�(���P��6h_-[�@�!���Pk���2n�}�?�L��� ��%���d����dN"m,�ǞDO97*�~��ɸ8�O�c|n���E������B��!$}�����;{���[����2���PK!�U0#�L _rels/.rels �(���MO�0   Appreciate any Help. Thanks
asked
1 answers
0

Hi Srinivas,

 

The REST-Service sends the document in chunks (Content-type: multipart/related). It could be that you only have the first chunk in the response. Is there a reason for the chunks? Maybe it works if the REST-Service could put the Content-Type to  application/binary.

 

Regards, Thijs

 

answered