on 2022 May 11 8:56 AM
Dear Experts,
We have a requirement in CPI where we have to send file attachment with SOAP request.
but after that attachment processing done we need to delete that attachment from message object, because it cause an error at next process step while I try to call SFDC SOAP service to upsert/create request.
Attachment is also going with SFDC call which must not be happened.
Even Router and Parallel Processing not working to drop attachment.
Can anyone please help here.
Thanks in Advance
Regards,
Rajesh
Request clarification before answering.
Hi Rajesh
I've deleted my previous answer, which was almost correct 🙂 I had half of the solution, and the always brilliant ilya.stepanov had the other half. The following code works:
import com.sap.gateway.ip.core.customdev.util.Message
def Message processData(Message message) {
message.getAttachments().clear()
message.getAttachmentWrapperObjects().clear()
return message
}
My first solution only cleared the attachments Map (the first line of the processData method). This would work in Apache Camel, which is Cloud Integration's underlying integration framework. However, for it to work in Cloud Integration, there is a Map of attachment wrapper objects, which must be cleared as well. This happens in the second line.
Have fun with CPI!
Regards,
Morten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
24 | |
22 | |
8 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.