on 07-04-2021 5:32 AM
Hi All ,
I am working on Proxy to REST Receiver Channel . i am receiving a pdf and how to send the attachment to ECC System .
Regards ,
Giridhar
Hi Giridhar,
I am assuming that you are getting the PDF as attachment with proxy message in PI. Then you need following code in UDF to read the attachment
String Content = "";
String AttachmentID ="";
InputAttachments inputAttachments = container.getGlobalContainer().getInputAttachments();
if(inputAttachments.areAttachmentsAvailable())
{
Collection<String> CollectionIDs = inputAttachments.getAllContentIds(true);
Object[] arrayObj = CollectionIDs.toArray();
int attachmentCount = arrayObj.length;
for(int i =0;i<attachmentCount;i++)
{
AttachmentID =(String) arrayObj[i];
Attachment attachments =inputAttachments.getAttachment(AttachmentID);
String s = new String(attachments.getContent());
Content = Content + s;
}
}
return Content;<br>
After reading the attachment you need to again attach the same to receiver REST adapter.
Since version PO 7.50 and SP07 a new functionality is added to the REST adapter that allows sending and receiving MIME multipart messages (as defined in https://tools.ietf.org/html/rfc2046#section-5.1). In addition, it is mandatory to update your REST adapter metadata with the one from 7.50 SP07 before you proceed with this scenario with help from BASIS team.
Details of configuring REST receiver adapter can be seen here.
Make following changes in receiver REST adapter.
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.