on 04-07-2016 4:38 PM
Hello everybody!
We have a following scenario: SOAP payload with attachment -> PI -> FTP payload with attachment. The requirement is to send the payload as XML file and application attachments, which can differ in the number and format, to FTP server.
AFAIK SOAP Axis receiver Adapter with an option "keep attachments" can be used. Is it possible to accomlish the task using the File FTP Adapter as a receiver?
Thanks!
Daiga
Here is what I would do,
<MT_Attachment>
<AttachmentContent> 0..N
In your Integration Directory, you may use the same or different File channels with the filename logic being set constant or dynamically as required.
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Daiga,
Have not tried this in a long time but this is what the code should look like,
GlobalContainer gc = container.getGlobalContainer();
InputAttachments ia = gc.getInputAttachments();
String ContentID = new String();
String base64 = "";
String contentType = "";
AbstractTrace trace = container.getTrace();
try
{
if(ia.areAttachmentsAvailable())
{
trace.addInfo("Input attachment available");
Collection<String> collectionIDs = ia.getAllContentIds(true);
for (Iterator<String> it = collectionIDs.iterator(); it.hasNext();)
{
ContentID = it.next();
Attachment attachment = inputAttachments.getAttachment(ContentID);
contentType = attachment.getContentType();
base64 = attachment.getBase64EncodedContent();
}
}
}
catch(Exception e)
{
}
Regards,
Bhavesh
Hello Daiga,
In my code below the content of output should be written as the output of your UDF.
GlobalContainer gc = container.getGlobalContainer();
InputAttachments ia = gc.getInputAttachments();
String ContentID = new String();
String contentType = "";
AbstractTrace trace = container.getTrace();
try{
if(ia.areAttachmentsAvailable()){
trace.addInfo("Input attachment available");
Collection<String> collectionIDs = ia.getAllContentIds(true);
for (Iterator<String> it = collectionIDs.iterator(); it.hasNext();){
ContentID = it.next();
Attachment attachment = inputAttachments.getAttachment(ContentID);
contentType = attachment.getContentType();
byte[] bytes = attachment.getContent();
String output= new String(bytes);
}
}
}
catch(Exception e){
}
Regards
Bhavesh
Hello Daiga,
As per my previous reply,
<MT_Attachment> <AttachmentContent> 0..N
So for every attachment you should create the target message type through your mapping. Your Interface determination will use this multi mapping and will split and create as many files as the attachments.
Let me know if there is something in specific you are unclear about.
Regards
Bhavesh
In the example you have provided,
RecordsetStructure: Attachment
Attachment.fieldSeparator : ,
Attachment.endSeparator: 'nl'
As there is only one field, the fieldseparator will not have any effect on the runtime
I am not sure if having endSeparator as nl will have a effect when you try to open the file or not. You can also leave this as blank.
Regards
Bhavesh
Hi Daiga,
File adapter does not support attachments, you can use SFTP adapter if your receiver support this because SFTP adapter supports attachment processing.
Regards,
Praveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.