2024 Apr 02 1:54 PM - edited 2024 Apr 03 6:56 AM
Hello SAP Experts,
i have a problem that I could use some advice on.
I want to create an attachment on the delivery document using API_CV_ATTACHMENT_SRV/AttachmentContentSet.
Via Postman, this works fine with the following header parameters:
As body i use "Binary" where i upload my pdf-File.
But when i try to build the same call in SAP Cloud Integration via an iFlow i get the following error:
As body i use a pdf File which i get as a response from another webservice with Content-Type "application/pdf".
Any hints ? Do i have to convert the file before calling the oData Service.
Tried to use the BASE64 Encode Function, but getting the same error.
Thanks in Advance.
Simon
Request clarification before answering.
Hi @Simon,
OData adapter in Cloud Integration has to be setup as XML document. If you send as payload a JSON string, it will cause that error.
https://me.sap.com/notes/0003074490
Please see the note statements here:
It is also valid for OData v4.
The note states that you must treat all payload in an iflow as XML and once it gets sent out to a backend server that requires JSON string as payload it will be converted internally by the adapter.
Best regards,
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Simon,
Try using a json2xml converter at the start of the iflow - if your sender's adapter is marked as OData as well.
Maybe the OData API doesn't require you to send any JSON payload at all, but from the iFlow perspective data should be assigned to the data model defined on an EDMX.
Also, import the data model via EDMX file you downloaded from API Business Accelerator Hub. Then perform any mappings necessary in the payload.
https://help.sap.com/docs/cloud-integration/sap-cloud-integration/importing-from-odata
Read more on OData integration here:
There is a nice blog using EDMX to consume OData service here:
Best regards,
Ivan
Hi @Ivan-Mirisola , i was able to solve the problem. I deleted to oData Adapter and switched to HTTP again. Now it works 🙂
Thanks for you support.
User | Count |
---|---|
62 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.