cancel
Showing results for 
Search instead for 
Did you mean: 

SAP APIM Attachment

itabhishek9
Participant
0 Kudos

Hi SDNites,

Requirement is - Source system needs to send an attachment to SAP CPI via SAP APIM.

I can see in SAP APIM debugging the the Content-Length is received as 0 and also wrote a small java script to see the content and that is coming as blank. Can you please advise how can send an attachment to SAP APIM from Source system or POSTMAN.

Regards,

Abhi

Accepted Solutions (0)

Answers (1)

Answers (1)

alex_bundschuh
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Abhishek,

I'm currently preparing a couple of scenarios about how to handle attachments in Cloud Integration which we plan to ship as part of the integration flow guidelines soon. Here's an example that works for me using Postman.

Use SOAP as sender adapter of your integration flow, http won't work with attachments.

Ensure that header content-type is defined as multipart/related in postman.

As body I defined a SOAP message with one attachment:

--uuid:09ee80b6-eb97-4f5f-b7d0-d981dfe352c6

Content-Type: text/xml; charset=UTF-8

Content-Transfer-Encoding: binary

Content-ID: <root.message@cxf.apache.org>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

<soapenv:Header/>

<soapenv:Body>

<Products>

<Product>

<ProductId>HT-1080</ProductId>

</Product>

</Products>

</soapenv:Body>

</soapenv:Envelope>

--uuid:09ee80b6-eb97-4f5f-b7d0-d981dfe352c6

Content-Type: text/xml;

Content-Transfer-Encoding: binary

Content-ID: <ProductDetails-HT-1080.xml>

Content-Disposition: attachment; name="ProductDetails-HT-1080.xml"; filename="ProductDetails-HT-1080.xml"

<?xml version="1.0" encoding="UTF-8"?>

<ProductDetails>

<ProductId>HT-1080</ProductId>

<Name>Photo Scan</Name>

<Category>Scanners</Category>

<DimensionDepth>0.4800</DimensionDepth>

<DimensionHeight>0.0500</DimensionHeight>

<DimensionUnit>m</DimensionUnit>

<DimensionWidth>0.3400</DimensionWidth>

<Weight>2.300</Weight>

<WeightUnit>KG</WeightUnit>

</ProductDetails>

--uuid:09ee80b6-eb97-4f5f-b7d0-d981dfe352c6--

I created an APIM proxy based on the integration flow end point that simply routes the request through APIM, I also tested with a policy (quota), I tested with both REST and SOAP, and both worked for me fine

Alex