Skip to Content
0
Former Member
Jan 15, 2010 at 07:39 AM

retrieving the attachment in the adapter module

17 Views

hi,

i have created an adapter module to retrieve the attachment payload. This module is placed after the Seeburger bic module chain. but everytime i execute the module i get null pointer exception.

i have used the following code to retrieve the attachment.

//code for retrieving the attachment

try {

Iterator itr = msg.getAttachmentIterator();

if (itr.hasNext()) {

while (itr.hasNext()) {

Payload attachment = (Payload) itr.next();

byte payLoadContent[] = null;

in_Data = attachment.getInputStream();

in_Data.read(payLoadContent);

attachmentContent = new String(payLoadContent);

break;

}

}

log(amkey, "The attachment " + attachmentContent, null);

} catch (Exception e) {

log(amkey, " Attachment not found ", e);

throw new ModuleException("Unable to retrieve the atachment payload"e"...exit module");

}

Please let me know how to resolve this error and also how can i retrieve the attachemnt payload.

Regards,

Meenakshi