Need to get the Mail attachment name as it is to the receiver file adapter

I am doing a Mail to File scenario. I need to get the attachment from the mail and store it on the file server. I am using the PayloadSwap bean in the sender mail adapter. My requirement is to carry forward the attachement name as it is to the receiver file adapter side and store the file with the same name.
Did any one try doing this? I was looking at developing an adapter module but got struck as I could not find whether the attachement name is stored in the XI payload after it has got swapped using the swap bean.
Any help would be appreciated.
VJ

Oops pressed the send key. Take two.
This is becoming a damn nightmare. When I run the adapter I am getting ModuleExceptions. Can you pass your eyes over these Java config settings to see what I am doing wrong. Using NWDS CE 7.1 with PI 7.1 both at SP07. All the imports were taken from PI 7.1 after SP07 was applied. The build id of NWDS is
SAP NetWeaver Developer Studio
SAP NetWeaver 7.1 Composition Environment SP07 PAT0001
Build id: 200901152336
APPLICATION.XML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
"http://java.sun.com/dtd/application_1_3.dtd">
<application>
<display-name>MailPOP_EAR</display-name>
<description>EAR description</description>
<module>
<ejb>MailPOP_EJB.jar</ejb>
</module>
</application>
APPLICATION-J2EE-ENGINE.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application-j2ee-engine SYSTEM "application-j2ee-engine.dtd">
<application-j2ee-engine>
<reference reference-type="hard">
<reference-target provider-name="sap.com" target-type="service">engine.security.facade</reference-target>
</reference>
<reference reference-type="hard">
<reference-target provider-name="sap.com" target-type="library">engine.j2ee14.facade</reference-target>
</reference>
<reference reference-type="hard">
<reference-target provider-name="sap.com" target-type="service">com.sap.aii.af.svc.facade</reference-target>
</reference>
<reference reference-type="hard">
<reference-target provider-name="sap.com" target-type="interface">com.sap.aii.af.ifc.facade</reference-target>
</reference>
<reference reference-type="hard">
<reference-target provider-name="sap.com" target-type="library">com.sap.aii.af.lib.facade</reference-target>
</reference>
<reference reference-type="hard">
<reference-target provider-name="sap.com" target-type="library">com.sap.base.technology.facade</reference-target>
</reference>
<fail-over-enable mode="disable" />
</application-j2ee-engine>
EJB-J2EE-ENGINE.XML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-j2ee-engine SYSTEM "ejb-j2ee-engine.dtd">
<ejb-j2ee-engine>
<enterprise-beans>
<enterprise-bean>
<ejb-name>GetMailAttachment</ejb-name>
<jndi-name>GetMailAttachment</jndi-name>
<session-props/>
</enterprise-bean>
</enterprise-beans>
</ejb-j2ee-engine>
EJB-JAR.XML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<description>EJB JAR description</description>
<display-name>EJB JAR</display-name>
<enterprise-beans>
<session>
<ejb-name>GetMailAttachment</ejb-name>
<home>com.sap.aii.af.lib.mp.module.ModuleHome</home>
<remote>com.sap.aii.af.lib.mp.module.ModuleRemote</remote>
<local-home>com.sap.aii.af.lib.mp.module.ModuleLocalHome</local-home>
<local>com.sap.aii.af.lib.mp.module.ModuleLocal</local>
<ejb-class>sample.GetMailAttachment</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>
SENDER MAIL ADAPTER modules
1 AF_Modules/PayloadSwapBean Local EB 1
2 GetMailAttachment Local EB 2
3 sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local EB 3
1     swap.keyName          payload-name
1     swap.keyValue          MailAttachment-1
RECEIVER FILE MODULES
1     localejbs/AF_Modules/DynamicConfigurationBean     Local Enterprise Bean     1
2     localejbs/CallSapAdapter                    Local Enterprise Bean     2
1     key.0          write http://sap.com/xi/XI/System/File FileName
1     value.0          message.interface
VARIABLE FILENAME SUBST WITH ASMA TURNED ON
fName     message:interface_name
JAVA SOURCE
package sample;
import javax.ejb.CreateException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import com.sap.aii.af.lib.mp.module.Module;
import com.sap.aii.af.lib.mp.module.ModuleContext;
import com.sap.aii.af.lib.mp.module.ModuleData;
import com.sap.aii.af.lib.mp.module.ModuleException;
import com.sap.engine.interfaces.messaging.api.Message;
import com.sap.engine.interfaces.messaging.api.MessagePropertyKey;
import com.sap.engine.interfaces.messaging.api.TextPayload;
import com.sap.engine.interfaces.messaging.api.XMLPayload;
import com.sap.aii.af.service.cpa.Channel;
@ejbHome <{com.sap.aii.af.lib.mp.module.ModuleHome}>
@ejbLocal <{com.sap.aii.af.lib.mp.module.ModuleLocal}>
@ejbLocalHome <{com.sap.aii.af.lib.mp.module.ModuleLocalHome}>
@ejbRemote <{com.sap.aii.af.lib.mp.module.ModuleRemote}>
@stateless
<code>GetMailAttachment</code>
@SuppressWarnings("unused")
public class GetMailAttachment implements SessionBean, Module {
     private static final long serialVersionUID = 7612238514043673502L;
     private SessionContext myContext;
     private MessagePropertyKey myFileName;
     public void ejbRemove() {
     public void ejbActivate() {
     public void ejbPassivate() {
     public void setSessionContext(SessionContext context) {
          myContext = context;
@throws CreateException
     public void ejbCreate() throws CreateException {
     public void getMessageProperty(MessagePropertyKey FileName) {
          myFileName = FileName;
@param moduleContext
           Contains data of the module processor that might be important
           for the module implementation such as current channel ID
@param inputModuleData
           Contains the input XI message as principal data plus eventual
           set supplemental data
@return ModuleData Contains the (changed) output XI message. Might be the
        response message if the module is the last in the chain.
@exception ModuleException
               Describes the cause of the exception and indicates whether
               an retry is sensible or not.
     @SuppressWarnings("deprecation")
     public ModuleData process(ModuleContext moduleContext,
               ModuleData inputModuleData) throws ModuleException {
          try {
               Message msg = (Message) inputModuleData.getPrincipalData();
               TextPayload payload = msg.getDocument();
               String contentType = payload.getContentType();
               // Content Type could be something like
               // text/plain;charset="UTF-8";name="file.txt"
               contentType = contentType.replaceAll("\"", "");
               int i = contentType.lastIndexOf("=") + 1;
               String fileName = contentType.substring(i);
               msg.setMessageProperty(myFileName, fileName);
               inputModuleData.setPrincipalData(msg);
          } catch (Exception e) {
          return inputModuleData;
JAVA ERRORS
2009-02-04 11:41:14     Information     Mail: calling the module processor for channel LMK_Common_Mail_Sender
2009-02-04 11:41:14     Information     Swap: swapping by payload-name ? MailAttachment-1
2009-02-04 11:41:14     Information     Swap: successfully swapped
2009-02-04 11:41:14     Information     Mail: message leaving the adapter (call)
2009-02-04 11:41:14     Information     The application tries to send an XI message asynchronously using connection AFW.
2009-02-04 11:41:14     Information     Backward validation is enabled
2009-02-04 11:41:14     Error     Unable to validate the message with message ID 8702df71-f254-11dd-9b9b-001a64a73518
2009-02-04 11:41:14     Error     Returning to application. Exception: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Content is not allowed in prolog.
2009-02-04 11:41:14     Error     Mail: error occured: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Content is not allowed in prolog.
2009-02-04 11:41:14     Error     Mail: error occured: com.sap.aii.af.lib.mp.module.ModuleException

Similar Messages

  • How to set dynamic name of the mail attachment according to source file ?

    Hi,gurus:
    Our scenario is like below:
    Sending files from an FTP server to another FTP server without using the integraiton repositary,and the file name is not changed .Now, we want to also send the file to some with by mail adapter.The scenario  now works by using two business services in receiver determination.But the name of the attachment is "untitled.xml".We know how to set the file name staticly,but how to set the name dynamicly according to the source file name ?
    I have checked miachel's blog "XI: Dynamic name in the mail attachment - pseudo "variable substitution"(/people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution),but how can I get the source file name?
    And another question:Must we restart the adapter or j2ee engine to make the user defined module work?

    Hi,
    >>>but how can I get the source file name?
    form dynamicconfiguration (ASMA)
    >>>And another question:Must we restart the adapter or j2ee engine to make the user defined module work?
    no need for a restart
    Regards,
    Michal Krawczyk

  • Email attachment name in sender mail adapter to the receiver file adapter

    HI ,
    Ths is regarding email to file scenario. I am trying to create file (in rceiver file adapter) with the same name as the email attachment that i read from mail sender adapter. I want ro use adapter module for this. I could find from blogs that there is module - GetAttachmentName - available that i can use for this in sender mail adapter.
    Can you please let me know what whetehr i neeed to mention any module key and parameters for this.
    I assume , i need to do following steps :Please confirm.
    1. i can use this module - after payload swap module and before standard mail adapter module in sender mail adapter
    2. select ASMA option in advanced tab in sender mail adapter
    3. In receiver file adapter select ASMA option in advanced tab in sender mail adapter
    4. Also select file name option in ASMA in sender mail adapter
    Thanks,
    Vamsi

    Hi Vamsi,
    your scenario is also described here: Re: sender mail adapter - attachment name
    If you use the Module getAttachmentName, which is described here,
    http://wiki.sdn.sap.com/wiki/display/XI/AdapterModulePI7.0GetAttachmentName
    your scenario should work as you described it.
    You just need to make sure that the Attachment Name that you read in the first place, is mapped to the Filename Attribute of the
    Fileadapter (http://sap.com/xi/XI/System/File/FileName).
    regards,
    Daniel

  • TS3276 I'm now having trouble getting mac mail to work on my mac. The mobile me account works great on iphone and ipad but it won't connect to my mail account. Password is correct. What else can I do? Using OS10.68

    I'm now having trouble getting mac mail to work on my mac. The mobile me account works great on iphone and ipad but it won't connect to my mail account. Password is correct. What else can I do? Using OS10.68

    HI,
    The Apple IDs from @mac.com and @me.com (Older MobileMe and more recent iCloud Names) are also Valid AIM Screen names.
    Any other sort of Apple ID is not a Valid AIM Name.
    A Google ID that is associated with Google Mail Account (And has "Talk" enable on your Google Settings) can be used in iChat as  Jabber Name/ID.  (Google Run  Jabber server).
    Jabber and AIM are different IM Services and it is not easy or straight forward to add Buddies from one Service to the Buddy List of another.  (As A Starting point consider it "impossible")
    iChat 4 and 5 have links to the registration page of @Mac.com here with a "Get an iChat Account" button in the add (Account) screen  (You select @mac.com or MobileMe and then press the Button - Choosing AIM and then pressing the button used to lead to the AIM registration page but AIM moved their page).
    Apple IDs can be any valid email (or an @mac.com or iCloud registration)
    Therefore you could make a Google ID into an Apple ID.
    However this will not be a valid AIM Screen Name the way @mac.com or MobileMe/iCloud ones are.
    Valid AIM Screen Names in Table (pic)
    7:46 PM      Monday; December 5, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • How do I customize the Email Attachment name in Email Bursting?

    I had worked on BI Publisher extensively on 10g and 11g. I have a client requirement with BIP email bursting to deliver the reports as email attachments. I'm able to do it, and also customize mail body etc. However the email attachment file name is randomly generated with some numbers. I read through the docs, and couldn't find any parameter mapping to the attachment/file name (like we do it with File bursting). How do I specify the mail attachment file names in my Busrting properties?
    Thanks,
    Padma

    Please go through the following link:
    http://garethroberts.blogspot.com/2008/03/bi-publisher-ebs-bursting-101.html
    I think after the 'Output' we can specify the filename

  • When I send a mail from my iPhone, it displays the mail server name to the receiver if the mail and does nog display my name or e mail address. This only since upgrading my iPhone5 to iOS7

    When I send a mail from my iPhone, it displays the mail server name to the receiver if the mail and does not display my name or e mail address. This only since upgrading my iPhone5 to iOS7. I've checked all settings etc. anyone have a solution please?

    Rectory wrote:
    Please can someone tell me how  I can change this so when I send a mail from my phone and from the IPad that it reads from me.
    You need a separate email address but you've already ruled out that solution.

  • I have an Iphone 5s with an account icloud that isn't an iCloud id, why? I cannot remove and the mail that names id doesn't exist anymore; what can I do?

    I have an Iphone 5s with an account icloud that isn't an iCloud id, why? I cannot remove and the mail that names id doesn't exist anymore; what can I do?

    Welcome to the Apple community.
    If you are unable to remember your password, security questions, don’t have access to your rescue address or are unable to reset your password for whatever reason, your only option is to contact Apple ID Support, upon speaking to an operator you should explain that your problem is related to your Apple ID, this way you will not be charged for assistance, even if you don’t have an AppleCare plan.
    You will need to show patience with the procedure and be prepared to demonstrate without question that the account belongs to you. Don’t expect access to be restored immediately and if you aren’t the owner of the Apple ID registered to the device the account won’t be reset.
    This is answer is provided from my own database of boilerplate responses and the content was last reviewed and/or tested on: 2014/12/18

  • A very simple question: how to obtain the mail server name?

    In our JSP application, at one point an email will be sent to notify one event. Currently, that is done by using the html tag: mailto. To have more control on the email in tems of context format (a bad layout right now) and others. I would like to have it processed at servlet by using the JavaMail API, so that it have a nice format and have the sender's email address right in case email client is not installed in the machine where the browser in. The JavaMail API is straight forward. The question is how to obtain the mail server name, and the sender's email address if there is one?
    Thanks.
    v.

    How to obtain the mail server's name? It's your server, you should know its name. Or if it isn't your server, you should ask the administrator for its name. Point is, you need to decide in advance what server you are going to use and hard-code its name into the program or into a properties file.
    And how to obtain the client's e-mail address? You have to ask the client, probably by putting a box in the HTML and asking them to type it.

  • Modify the SOAP attachment name

    hi,
    I have a Service with Party, which sends messages in SOAP format to XI.
    When the SOAP message sent to XI contains a '&' character in its attachment name, the message gets failed to processed through XI.
    I believe this happens since '&' character is a wildcard character in XML hence XI expects a escape character sequence following it and cannot parse through the '&' character. Also as per the IR tests executed for the SOAP message, when the '&' is replaced with its escape sequence the message is processed through successfully.
    Is it possible to replace the '&' character with its escape sequence in the SOAP attachment name before it is processed by the XI Integration Engine. That is at the adapter level?
    regards,
    Diptee
    Edited by: diptee s on Oct 26, 2010 4:47 PM

    hi,
    i have created the Java Mapping .
    in the pdf document How Tou2026Work with Character Encodings in Process Integration from SAP, for the Escape sequences it is said that for adding Escape sequences to the unescaped characters, add the Java mapping before the required mapping.
    however, i am not able to test the interface in the IR even after adding the new Java mapping.
    please suggest.
    regards,
    Diptee

  • My phone has been smashed I need to get records of all my iMessages and texts from the last month. How do I get these?

    My phone has been smashed I need to get records of all my iMessages and texts from the last month. How do I get these?

    Do you have a backup of your iPhone which contains these messages?
    If so, you can restore a new iPhone from that backup during setup.
    If not, the messages are gone.

  • I deleted my old Email account because I wanted to create a new one, and I did. However, when ever I send an Email from the Mail app on my laptop it says the Email was sent from my old Email and I just can not get rid of it.

    I deleted my old Email and only used my new Email to set up the Mail app on my laptop. And the old Email is completely dead, hotmail.com says the Email no longer excists when I try to sign back in to it however my Emails remain saying 'Sent from Jordan [*old Email*].
    I can't find a solution!!

    If you are unable to remember your password, security questions, don’t have access to your rescue address or are unable to reset your password for whatever reason, your only option is to contact AppleCare(or Apple ID Support), upon speaking to an operator you should explain that your problem is related to your Apple ID, this way you will not be charged for assistance, even if you don’t have an AppleCare plan.
    The operator will take you through some steps you may have already tried, however they need to be sure they have exhausted all usual approaches before trying to reset your account, so you should try to be helpful and show patience with the procedure.
    The operator will need to verify they are speaking to the account holder and may ask you some questions that only the account holder could know, and you will need to answer them if the process is to proceed.
    Once the operator has verified your identity they will send a message through to your device which contains an alpha numeric code, which you will need to read back to them.
    Once this has been completed they will send an email to your iCloud email address after a period of 24 hours, so you should check that mail is enabled in your devices iCloud settings.
    Upon receipt of the email, use the reset link provided to reset your password, after which you should be able to make the adjustments to iCloud that you wish to do.

  • HT1689 I need to get my iPod to no longer be associated with the original i store account. My husband set it up through his account but now I have my own account. I don't want to go through his every time I want to make a change. how do I make this change

    I need to get my iPod to no longer be associated with the original i store account. My husband set it up through his account but now I have my own account. I don't want to go through his every time I want to make a change. how do I make this change?

    I am trying to stop using my I-pod under my husband's I-Tune account.  It was set up under his account and the only way I can use it under my account is to erase all of the songs my husband loaded on for me.  I had heard there is a duration that I-Pods are locked into to one account only, and I am trying to discover how I can use my account without having to erase everything on the I-Pod.  I know it sounds confusing but that's the way I-tunes have set it up.  thanks for asking.

  • When I forward or reply to the email from Mail, the receiver gets it as multiple attachments with no content in the mail., When I forward or reply to the email from Mail, the receiver gets it as multiple attachments with no content in the mail.

    When I forward or reply to the email from Mail, the receiver gets it as multiple attachments with no content in the mail., When I forward or reply to the email from Mail, the receiver gets it as multiple attachments with no content in the mail.

    That's probably because the message is in HTML format. Send the reply as plain text.

  • TS2755 How do get my mail on my ipad 3 to set the same email rules as is on my imac ???

    How do get my mail on my ipad 3 to set the same email rules as is on my imac ???

    Setting up and troubleshooting Mail
    http://www.apple.com/support/ipad/assistant/mail/
    iPad Mail
    http://www.apple.com/support/ipad/mail/
     Cheers, Tom

  • At work we have many who travel with train alot, where the internet is very unstable at best. And  they have trouble getting their e-mails. So the question is if there is a way to increase the mail cache in iOS 7, to lower the dependence of internet.

    At work we have many who travel with train alot, where the internet is very unstable at best. And  they have trouble getting their e-mails.
    So the question is if there is a way to increase the mail cache in iOS 7, to lower the dependency of a very poor internet connection.

    I don't think so. Unless it's in the settings, there's not much that can be done.
    are they using wifi on the train? If so, maybe switching to cellular. There are devices like the Mifi, which is a battery operated portable wifi hotspot that they can connect their device to.
    If the wifi on the train is solid, I know I've had issues using certain hotspots. For example, my yahoo mail simply will not pull down via the mail app if I'm on some AT&T hot spots. But if I go in via safari then it works. So if the signal is good, maybe using a different way can help.
    Or maybe looking for a mail interface that isn't apple's. There are others in the app store that may have better function or more control.

Maybe you are looking for