cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get filename from mail to XI to file scenario

asgarali_mia
Explorer
0 Kudos

Hi

How could i get the name of an attachment to be used as the file name on my File Adapter in a Mail to file scenario?

I recieve the files as attachments and I have used the payload swap bean to swap my actaull message content to attachment. That works perfect, the contents of the file are saved successfully on my file system. The file is sent as a plain text file and not xml and no mapping is done, I just get the files from the mail and save them into a file server for further processing.

Your help will be highly appreciated

Ronny

Accepted Solutions (0)

Answers (4)

Answers (4)

stefan_grube
Active Contributor
0 Kudos

Check this thread:

Regards

Stefan

asgarali_mia
Explorer
0 Kudos

Hi Both Stefan and krishna

Your responses are excellent and I think a combination will help me get to what I want. Since I will be developing a module for the first time - thanks to the assistance on the documentation you sent, it will take me abit of some time to get it sorted.

I am forsure will be jumping on it right away. Will let you know of the progress.

Thanks again

I will award reward after closing this thread, obviously it would have to be after I get it running.

Regards

Ronny

asgarali_mia
Explorer
0 Kudos

Hi again

I've read through the Java code and understand exactly what it does. I would then load up my module from teh Moul tab under my reciever adpter and setup my module configuration. Now how would I use it from the Configuration side of the File Adapter. I.e. under file name I will enter %filename% which is my variable. Under Variable substitution (Target Directory/File Name Scheme) Varable Name = filename. Question, what will I put under Reference? "payload:<what>"?

Regard

Ronny

asgarali_mia
Explorer
0 Kudos

Hi

I have installed my Module, but when I try to call it from within the adapters I get an error

exception caught during processing mail message [614]com.sap.aii.af.mp.processor.ModuleProcessorException: Error during processing local bean: localejbs/mailAttachmentFileNames caused by: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of mailAttachmentFileNames.

I have searched all the logs and the module is active. I even restarted my J2EE engine, twice but still nothing..

please assist

Ronny

stefan_grube
Active Contributor
0 Kudos

That message usually comes, when you have the adapter framework libraries in the EAR file.

make sure that you hav only the jar file of your class and no additional jar files in the EAR. Use WinZip/WinRar to delete them.

Regards

Stefan

asgarali_mia
Explorer
0 Kudos

Hi

Sorted. I was running the adapter module on the wrong communication channel. I changed it and ran it under the File Adapter reciever, and it worked. Becuase the FileName field is populated within the java class, there was no need to use the variable substitution. I put in a normal filename and it got overwritten by my module and it worked!

Thank you all for all your help

Regards

Ronny

Former Member
0 Kudos
asgarali_mia
Explorer
0 Kudos

Hi

Thank you for the speedy response everyone. I however cannot view the document sent nor can I download it. Do you have any other URL. I think it will be very important for me to have a look at this document or something similar as i dont knnow how to build my own modules within XI. I know how to program in java but have never used it within XI, except to create my own functions during field mapping. I am also a newbie in XI, so please bare with me.

Please assist with nother URL to the document or any other URL that shows step by step how to create a module.

Ronny

Former Member
Former Member
0 Kudos

Hi

in UDF, after getting the message, use getProperty to get the filename and setProperty() for setting the filename.

here are some blogs on dynamic config

/people/michal.krawczyk2/blog/2006/10/09/xi-dynamic-configuration-in-adapter-modules--one-step-further

/people/daniel.graversen/blog/2006/10/05/dynamic-configuration-in-adapter-modules

regards

krishna

Former Member
0 Kudos

You can use "adapter specific parameters" and dynamic configuration to acheive this

regards

krishna