Hi Experts,
I working a requirement where i need to send the attachment along with the message payload. My scenario is REST to SOAP. I tried below blogs and the code.
https://archive.sap.com/discussions/thread/3722207
https://archive.sap.com/discussions/thread/3956705
UDF code:
- String attachmentID =null;
- GlobalContainer globalContainer = container.getGlobalContainer();
- InputAttachments inputAttachments = globalContainer.getInputAttachments();
- if(inputAttachments.areAttachmentsAvailable())
- {
- Collection<String>CollectionIDs= inputAttachments.getAllContentIds(true);
- Object[] arrayObj =CollectionIDs.toArray();
- attachmentID =(String)arrayObj[0];
- Attachment attachment = inputAttachments.getAttachment(attachmentID);
- int attachmentsize = attachment.getContent().length;
- return"Attachment Name : "+attachmentID +" Attachment Size : "+attachmentsize+" bytes";
- }
- else{
- return"no attachment found";
- }
I am not able to get the same attachment name in the receiver and format too.
My source attachment name is : 2365727_E_20181219.pdf and
Target attachment name i am getting is like this. cid%3Aatt-43c91c58158811e9aeb9000000622a47@sap20190111-100422-352.com.
Please help on fixing in this issue.
Thanks in Advance.
Pavan T