Sender "Mail" adapter - CSV file attachment

Hi there
I'm looking for some help in configuring a sender mail adapter that receives ".csv" files. I did read some blogs that mention using the "PayloadSwapBean" module to read the mail attachment instead of the mail content. My problem is to now convert the ".csv" file into a message. Is there a module that I can use ( is it the "MessageTransfomBean" ) and how. Any help would be appreciated.
Thanks
Salil

Hi Salil,
If you want to send a mail with a body and attachments, the message sender HAS to provide an XI message with attachments. I doubt a CSV file does justice.
As Renjith said you need to convert CSV to XmL.
A short description about the Standard Modules:
MessageTransformationBean is a standard module used to apply the XSLT mapping to the adapter module by using <i>Transform.class</i> ( This xslt mapping is done to create a mail package, Dont confuse with the actual mapping in your case this is NOT for converting csv to xml).
Also this module can be used to change the name and type of payloads by using <i>Transform.contentType</i>, <i>Transform.contentDisposition</i>, <i>Transform.contentDescription</i>.
PayloadSwapbean is a standard module for replacing payloads with other payloads (SWAP)
If you want to give each attachment a certain name use Parameters, <i>swap.keyname</i> for name of the payload and <i>swap.keyvalue</i>.
I Hope the use of standard modules is understood.

Similar Messages

  • Send mails with csv file as an attachment through oracle(SQL SCripts / Stor

    Hello Everybody,
    I have recently come across a requirement in which I am supposed to send mails with csv file as an attachment through oracle(SQL SCripts / Stored Procedure) .
    The contents of the csv file are to be retreived from the Database as well as the content of the mail and to whom it needs to be sent has also to be picked up from the database.
    Can somebody suggest me with a suitable code for the same?
    Would be of great help..!!
    Thanks & Regards,
    - VR
    Edited by: user646716 on Dec 18, 2009 10:44 AM

    read below links
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:255615160805
    http://www.orafaq.com/wiki/Send_mail_from_PL/SQL#Send_mail_with_UTL_TCP_-withattachments
    How to send csv file as an attachment

  • Sender Mail adapter configuration with attachment

    Hi,
    I read the below blog regarding the mail adapter
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    I have the same requirement but the attachment file is not an XML, it is CSV file so in the module tab if I change like below is it enough?
    TRANSFORM    swap.keyValue  attachment; filename=u201DMailAttachment-1.csvu201D     (I think MailAttachment-1 is the file name, am I correct?)
    If I change like above is it ok? or any other thing is required, Could you please give me the inputs
    Thanks
    Ramesh

    I have the same requirement but the attachment file is not an XML, it is CSV file so in the module tab if I change like below is
    it enough?
    PayloadSwapBean will ensure that the input to the mapping is from the attachment.....in the blog the attachment is in XML format and hence there was no need for any conversion.....yours is however a CSV file so you need to convert it to XML first and then do the further processing.....you can either use the MessageTransformationBean as shown in this blog:
    /people/gabrielsagayaselvam.panneerselvam/blog/2009/08/31/solve-key-field-problem-using-structplain2xml-in-messagetransformationbean
    Or write your own module code for the conversion.
    Regards,
    Abhishek.

  • Mail adapter flat file attachment

    Hi,
    From my limited knowledge of XI, I know that we can send an email attachment as an .xml file or a binary file. My question is how can I send a flat file as an attachment using XI's mail adapter? If this is possible, please suggest steps how to do this as I am clueless!!
    Thanks for your help...
    Chandu

    Hi,
    check out this Blog you will be able to do it.
    You can do either using Mail package or just using Mail adapter.
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/content.htm
    Thanks,
    Prakash

  • Mail Adapter ZIP File Attachment

    Hello,
    I have created an interface using the mail receiver to mail a file as an attachment to an email address. I have used an ABAP mapping to create the Mail message associating the required content of Mail message. This all works fine and the emails with the required attachments are delivered successfully.
    I now need the ability to ZIP the file attachments. I have had a look through some of the forum messages and it looks like I am going to have to create a java module for the receiver mail adapter to ZIP the file.
    Has anyone done this before? If so can you give me some pointers. I have developed modules for the file adapter but am not sure how to ZIP.
    Alternatively can this be done as part of the ABAP mapping. I have started looking at class CL_ABAP_ZIP. I am now able to compress the content but this does not create a valid archive as the attachment.
    Any help would be much appreciated.
    Thanks
    Gary

    Dear Sameer ,
    Can you send me the Java Code which zips the folder or files .
    My email id is [email protected]
    Regards
    Prabhat

  • Sending mail with PDF file attachment ?

    Hi All,
    I have scenario File ---> Mail, monitoring FTP directory for PDF file and sending using mail attachment.
    At the moment i am using JAVA mapping to construct the mail package structure follow all the step in this blog : XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping
    it is working if i am using text file but then how to encode the pdf content so i can send throught the mail adapter. ?
    Thank you and Best Regards
    Fernand

    Hi,
    Actually, i am using this java code below :
    try {
        //     create XML structure of mail package
        String output = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
               + "<ns:Mail xmlns:ns=\"http://sap.com/xi/XI/Mail/30\">"         
               + "<Subject>" + mailSubject     + "</Subject>"
               + "<From>" + mailSender     + "</From>"
               + "<To>" + mailReceiver     + "</To>"
               + "<Content_Type>multipart/mixed; boundary=\"" + boundary + "\"</Content_Type>"
               + "<Content>";
        out.write(output.getBytes());
        // create the declaration of the MIME parts
        //First part
        output = "--" + boundary + CRLF
               + "Content-Type: text/plain; charset=UTF-8" + CRLF
               //+ "Content-Transfer-Encoding: 8bit" + CRLF
               + "Content-Disposition: inline" + CRLF + CRLF
               + mailContent + CRLF
        //Second part
        + "--" + boundary + CRLF
        + "Content-Type: Application/pdf; name=" + attachmentName + CRLF  
        //+ "Content-Transfer-Encoding: base64" + CRLF
        + "Content-Disposition: attachment; filename=" + attachmentName + CRLF + CRLF;
        out.write(output.getBytes());
        //Source is taken as attachment
        copySource(in, out);
        out.write("</Content></ns:Mail>".getBytes());
      } catch (IOException e) {
        throw new StreamTransformationException(e.getMessage());
    protected static void copySource(InputStream in, OutputStream out)
         throws IOException {
        byte[] bbuf = new byte[in.available()];
        int bblen = in.read(bbuf);
        if (!(bblen < 0)) {
          //String sbuf = new String(bbuf);
          //String encoded = Base64.encode(sbuf);
          // replace all control characters with escape sequences
          //sbuf = sbuf.replaceAll("&", "&amp;");
          //sbuf = sbuf.replaceAll("\"", "&quot;");
          //sbuf = sbuf.replaceAll("'", "&apos;");
          //sbuf = sbuf.replaceAll("<", "&lt;");
          //sbuf = sbuf.replaceAll(">", "&gt;");
          out.write(bbuf);
    This code working fine with text file but not for pdf file. because i got error in mail adapter :
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: com.sap.aii.messaging.util.XMLScanException: java.lang.NullPointerException; nested exception caused by: com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Unsupported character: 8f(:main:, row:11, col:4)(:main:, row=11, col=4) -> com.sap.engine.lib.xml.parser.ParserException: Unsupported character: 8f(:main:, row:11, col:4)
    I guest the problem because the mail adapter doen't accept pdf content insite the mail package.
    please advise me
    Best Regards
    Fernand

  • Problem in send mail with .txt file attached

    According to the diferent checks, I found the next problems:
    1.- Between each caracters there is an space, example:(E Q U I P M E N T) and could be (EQUIPMENT), the last one is the correct form.
    2.- For example, two registers in my internal table appear in one line of my .txt file, but i want that each register of my internal table appear in differents lines of my .txt file.
    3.- The length of each register of my internal table (objbin) is 255 characters, but i really want that the length of each register of my internal table be 1023 characters.
    Thank you

    This is my perform:
    FORM z_envia_correo .
      DATA: docu_data LIKE SODOCCHGI1,
            tablines TYPE i,
            destinatarios  like somlreci1  occurs 1 with header line.
      DATA: BEGIN OF packlist OCCURS 0.
              INCLUDE STRUCTURE SOPCKLSTI1.
      DATA: END OF packlist.
      DATA: BEGIN OF objbin OCCURS 0.
              INCLUDE STRUCTURE SOLISTI1.
      DATA: END OF objbin.
      DATA: BEGIN OF object_header OCCURS 0.
              INCLUDE STRUCTURE SOLISTI1.
      DATA: END OF object_header.
      DATA: BEGIN OF contents OCCURS 0.
              INCLUDE STRUCTURE SOLISTI1.
      DATA: END OF contents.
    *-->ihv270907
      DATA: l_string TYPE string,
            l_fecha(10) TYPE c,
            l_dia(2) TYPE c,
            l_mes(2) TYPE c,
            l_ano(4) TYPE c,
            l_hora(8) TYPE c,
            l_h(2) TYPE c,
            l_min(2) TYPE c,
            l_seg(2) TYPE c.
    *<--ihv270907
    Variable del destinatario para enviar el mail
      DATA: l_usrnam TYPE string.
    *Caracter salto de linea
      FIELD-SYMBOLS <hex_container> TYPE c.
      CONSTANTS: zz_tab TYPE x VALUE '0D' LENGTH 4. "valor del salto de linea en hexadecimal
      ASSIGN zz_tab TO <hex_container> CASTING.
    cargo el texto de cabecera del mail
      CLEAR docu_data.
      docu_data-obj_name = 'ZFLOTA'.
      CONCATENATE 'ZFLOTA' sy-datum INTO docu_data-obj_descr SEPARATED BY space.
      docu_data-proc_type = 'T'.
      docu_data-proc_name = 'ZFLOTA'.
    cargo el texto del cuerpo del mail
      CLEAR contents.
    *-->ihv270907
      l_string = TEXT-I04.
      REPLACE '&' IN l_string WITH sy-uname.
      l_ano = sy-datum+0(4).
      l_mes = sy-datum+4(2).
      l_dia = sy-datum+6(2).
      CONCATENATE l_dia l_mes l_ano INTO l_fecha SEPARATED BY '/'.
      REPLACE '&' IN l_string WITH l_fecha.
      l_h = sy-uzeit+0(2).
      l_min = sy-uzeit+2(2).
      l_seg = sy-uzeit+4(2).
      CONCATENATE l_h l_min l_seg INTO l_hora SEPARATED BY ':'.
      REPLACE '&' IN l_string WITH l_hora.
      contents = l_string.
    *<--ihv270907
      APPEND contents.
      DESCRIBE TABLE contents LINES tablines.
      READ TABLE contents INDEX tablines.
      docu_data-doc_size = ( tablines - 1 ) * 255 + STRLEN( contents ).
    cargo el contenido del attachmet
      LOOP AT g_gt_outtab_mail.
        g_gt_outtab_mail-line+254(1) = <hex_container>.
        MOVE g_gt_outtab_mail-line TO objbin-line.
        APPEND objbin.
      ENDLOOP.
    genero el nombre del archivo a ser attachado
      CLEAR object_header.
      object_header-line = 'ZFLOTA.txt'.
      APPEND object_header.
    armo las caracteristicas del mail
      CLEAR packlist.
      packlist-head_start = 1.
      packlist-head_num = 0.
      packlist-body_start = 1.
      packlist-body_num = tablines.
      packlist-transf_bin = space.
      packlist-doc_type = 'RAW'.
      APPEND packlist.
    armo las caracteristicas del attachment
      DESCRIBE TABLE objbin LINES tablines.
      packlist-transf_bin = 'X'.
      packlist-head_start = 1.
      packlist-head_num = 0.
      packlist-body_start = 1.
      packlist-body_num = tablines.
      packlist-doc_type = 'TXT'.
      packlist-obj_name = 'ZFLOTA.txt'.
      packlist-obj_descr = 'ZFLOTA.txt'.
      packlist-doc_size = tablines * 250.
      APPEND packlist.
    Destinatarios
      l_usrnam = sy-uname.
      MOVE: l_usrnam TO destinatarios-receiver.
      destinatarios-rec_type = 'B'.   "U externo; B -> SAP
      destinatarios-sap_body = 'X'.
      APPEND DESTINATARIOS.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA                    = docu_data
          PUT_IN_OUTBOX                    = 'X'
          COMMIT_WORK                      = 'X'
        TABLES
          PACKING_LIST                     = packlist
          OBJECT_HEADER                    = object_header
          CONTENTS_BIN                     = objbin
          CONTENTS_TXT                     = contents
          RECEIVERS                        = destinatarios
    EXCEPTIONS
      TOO_MANY_RECEIVERS               = 1
      DOCUMENT_NOT_SENT                = 2
      DOCUMENT_TYPE_NOT_EXIST          = 3
      OPERATION_NO_AUTHORIZATION       = 4
      PARAMETER_ERROR                  = 5
      X_ERROR                          = 6
      ENQUEUE_ERROR                    = 7
      OTHERS                           = 8
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " z_envia_correo
    Thank you.

  • How to download / read  text attachment  in Sender Mail Adapter  IN XI

    Hi
    I would like to know how to download / read text attachment in sender mail Adapter & sent same attachment to target system using file adapter.
    Please help how to design / resolve this concept.
    Regards
    DSR

    I would like to know how to download / read text attachment in sender mail Adapter & sent same
    attachment to target system using file adapter.
    Take help from this blog:
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    From the blog:
    However in most cases
    our message will not be a part of the e-mail's payload but will be sent as a file attachment.
    Can XI's mail adapter handle such scenarios? Sure it can but with a little help
    from the PayloadSwapBean adapter module
    Once your message (attachment) is read by the sender CC, you can perform the basic mapping requirement (if any) to convert the mail message fromat to the file format.....configure a receiver FILE CC and send the message...this should be the design...
    Regards,
    Abhishek.

  • Security requirements on sender mail adapter

    I have set up a sender mail adapter to fetch the email with attachment from MS exchange mail server. The sender mail adapter can process the attachment well and convert it to XML format. Now I have a new requirement to determine if the email comes from a particular user. I can see the FROM field in the payload "MailMessage" But I don't know how to get the value of this field. Any idea on how to set up the message mapping? Thanks in advance.

    Before the sender mail adapter processes the attachment in the email, it need to determine the email is actaully from the business user not someone else on server. Cuz everyone can send email to the email address the mail adapter connects to, that is why this security issue comes from.
    Basically when you fetch a email with attachment, in Sxi_monitor, you can see two field in the payload, One is MailMessage and the other is MailAttachment-1. In the MailMessage, you can see all the emial header fields, such as From, To, Subject, Content etc. I need to check if the FROM field is email address we allowed. That is basic requirements. Let me knwo if you want me to explain it further.
    Edited by: Bai Li on Dec 23, 2010 6:02 AM

  • Dynamic file name of the attachment in sender mail adapter

    Hi
    I have configured a sender mail adapter which receives some attachments.
    Right now the file name of the attachment is hardcoded to "MailAttachment-1" "MailAttachment-2" using the content-description from "AF_Modules/PayloadSwapBean" module.
    I want to set it to dynamic ie. instead of "MailAttachment-1"... i want it with real name of the attach.
    please suggest a solution w/o the need to develop a custom adapter module.
    Thanks!
    Regards,
    Mariano.

    Thanks Prateek,
    Now, i can see that the name of the original file is into the content type named as  text/xml; name"name of the file.xml" when i send the email from outlook.
    If i send it from hotmail, this is not happend.
    Do you know why happend this?
    If i always would have the original name inside the content type, my problem will be solved.
    Edited by: Mariano Vidal on Feb 13, 2009 2:26 PM

  • 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

  • How to process a text file (mail attachment) using the sender mail adapter?

    Hi guys,
    Is it possible to process mail attachments using the sender mail adapter? Let's say I have a structured text file (attachment) which needs to be mapped and sent to target system.
    Post please any thoughts or experience.
    Thanks,
    Olian

    Hi Olian,
    Have a look at these helpful links -
    1. http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/9e6c7911-0d01-0010-1aa3-8e1bb1551f05&overridelayout=true
    2. http://www.riyaz.net/blog/xipi-configuring-the-sender-mail-adapter/
    3. http://help.sap.com/saphelp_nw70/helpdata/en/23/c093409c663228e10000000a1550b0/content.htm
    Regards,
    Sunil Chandra

  • Read multi-tabbed excel file attachments from Sender Mail Adapter.

    There is a need to read excel attachments from incoming email to a
    mailbox. We know we can use Sender Mail adapter to easily read .xml, .txt
    or .csv attachments.
    For excel attachments we know from SDN that you have to write
    adapter modules to handle excel. However the excel file we need to read has
    multiple worksheets(tabs) and data may be contained in any of them.
    Is it possible to use SAP XI Mailsender adapter to read such a file as an attachment? What kind of module development would we need for this? I am not much of a Java programmer so examples or links to other documentation would help.
    Thanks,
    Rudra

    Rudra,
    Use Java Mapping.  There is a free java api available called JExcelAPI to achieve this. 
    Shabarish's blog describes about this.  This might be helpful to you
    /people/shabarish.vijayakumar/blog/2009/04/05/excel-files--how-to-handle-them-in-sap-xipi-the-alternatives

  • Sender mail adapter - attachment name

    Hi there
    We have configured a sender email adapter to receive text/csv attachments and save them to a file system. What we are having a problem with is reading the attachment name. So we are using Dynamis Configuration to create the file name using the subject line - Which is not ideal. Ideally we would like to use the same name as the origianl attachment but haven't found any way of doing that. We even tried using Content-type in the Variable Header (XHeaderName1) suing variable transport binding but it doesn't show up in the Dynamic Config part of the SOAP message.
    Is there any way of reading the name of the file attachment? We are on PI release 7.0.
    Any help would be appreciated.
    Cheers
    Salil

    Hi Vitor
    There are 2 scenarios that I can think of -
    1. You are saving the email attachment as a file. In that case use step 3 in the earlier reply to get the attachment name and save the file witht that name.
    2. You are sending the XML straight to a receiver using HTTP, IDOC, JDBC etc. in which case you would need the attachment name much earlier that step 3. For that I guess you would have to write another adapter module on the sender mail adapter(at Position 3 where position1 = payloadswap bean, 2 = custom module to get the attachment name) and add an xml tag to your incoming message. These adapter modules are really powerful and are like user exits in ABAP. In that case you would have to change the Data Type in the Integration repository to reflect that extra tag. Here is some code from a module we wrote to totally change the structure of the xml coming in. The key thing to remember is this module is that you can read the whole message byte by byte. There might be smarter ways of doing it (like using the SAP XML parser factory class) but since I'm not a Java programmer I stuck to the basics. Here's the code( you could also look at the example given in sap help where they remove (or add I'm not sure) CR(carriage return) from CRLF (CR Line feed).
    Created on Aug 8, 2007
    To change the template for this generated file go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    package jdbcPackage;
    import javax.ejb.CreateException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import com.sap.aii.af.mp.module.*;
    import com.sap.aii.af.ra.ms.api.*;
    @author Salil.Mehta Soltius NZ Ltd
    To change the template for this generated type comment go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    public class jdbcClass implements SessionBean, Module {
         private SessionContext myContext;
         public void ejbRemove() {
         public void ejbActivate() {
         public void ejbPassivate() {
         public void setSessionContext(SessionContext context) {
              myContext = context;
         public void ejbCreate() throws CreateException {
         public ModuleData process(
              ModuleContext moduleContext,
              ModuleData inputModuleData)
              throws ModuleException {
              //        put your code here
              try {
                   Message msg = (Message) inputModuleData.getPrincipalData();
                   XMLPayload payload = msg.getDocument();
                   String payEnc = payload.getEncoding();
                   byte[] payByte = payload.getContent();
                   byte[] payByteOut = new byte[payByte.length];
                   byte[] payByteTemp = new byte[payByte.length];
                   int i;
                   int j;
                   int actualCount = 0;
                   char xmlTagFound = ' ';
                   char endXmlTagFound = ' ';
                   char tagFound = ' ';
                   System.arraycopy(payByte, 0, payByteTemp, 0, payByte.length);
                   // Step 1 - Conversions 
                   // convert   "&lt; to <"    and     "&gt; to >"
                   // convert   &quot; to "
                   // This will remove any carriage returns and line feeds
                   // and the <XML* and </XML* tags plus the <row> and </row> tags
                   for (i = 0; i < payByte.length; i++) {
                        // convert   &lt; to <    and     &gt; to >
                        if (payByteTemp<i> == '&') {
                             if (payByteTemp[i + 1] == 'l') {
                                  if (payByteTemp[i + 2] == 't') {
                                       if (payByteTemp[i + 3] == ';') {
                                            payByteTemp<i> = '<';
                                            payByteTemp[i + 1] = '\n';
                                            payByteTemp[i + 2] = '\n';
                                            payByteTemp[i + 3] = '\n';
                        if (payByteTemp<i> == '&') {
                             if (payByteTemp[i + 1] == 'g') {
                                  if (payByteTemp[i + 2] == 't') {
                                       if (payByteTemp[i + 3] == ';') {
                                            payByteTemp<i> = '>';
                                            payByteTemp[i + 1] = '\n';
                                            payByteTemp[i + 2] = '\n';
                                            payByteTemp[i + 3] = '\n';
                        if (payByteTemp<i> == '&') {
                             if (payByteTemp[i + 1] == 'q') {
                                  if (payByteTemp[i + 2] == 'u') {
                                       if (payByteTemp[i + 3] == 'o') {
                                            if (payByteTemp[i + 4] == 't') {
                                                 if (payByteTemp[i + 5] == ';') {
                                                      payByteTemp<i> = '"';
                                                      payByteTemp[i + 1] = '\n';
                                                      payByteTemp[i + 2] = '\n';
                                                      payByteTemp[i + 3] = '\n';
                                                      payByteTemp[i + 4] = '\n';
                                                      payByteTemp[i + 5] = '\n';
                        // This will take in the initial xml declaration from the Byte array
                        // And we also don't want the stuff after the xml declaration till
                        // we reach the first <row> tag     
                        if (xmlTagFound == ' ') {
                             if (payByteTemp<i> == '>') {
                                  xmlTagFound = 'X';
                             payByteOut[actualCount++] = payByteTemp<i>;
                             if (xmlTagFound == 'X') {
                                  payByteOut[actualCount++] = '\r';
                             continue;
                        if (xmlTagFound == 'X') {
                             if (payByteTemp<i> == '<') {
                                  if (payByteTemp[i + 1] == 'r') {
                                       if (payByteTemp[i + 2] == 'o') {
                                            if (payByteTemp[i + 3] == 'w') {
                                                 if (payByteTemp[i + 4] == '>') {
                                                      xmlTagFound = 'Y';
                                                 } else {
                                                      continue;
                                            } else {
                                                 continue;
                                       } else {
                                            continue;
                                  } else {
                                       continue;
                             } else {
                                  continue;
                        // Carriage return and line feed
                        if ((payByteTemp<i> == '\r') || (payByteTemp<i> == '\n')) {
                             continue;
                        // <XML_*> tag
                        if (payByteTemp<i> == '<') {
                             if (payByteTemp[i + 1] == 'X') {
                                  if (payByteTemp[i + 2] == 'M') {
                                       if (payByteTemp[i + 3] == 'L') {
                                            tagFound = 'X';
                                            endXmlTagFound = ' ';
                                            continue;
                        // </XML_*> tag
                        if (payByteTemp<i> == '<') {
                             if (payByteTemp[i + 1] == '/') {
                                  if (payByteTemp[i + 2] == 'X') {
                                       if (payByteTemp[i + 3] == 'M') {
                                            if (payByteTemp[i + 4] == 'L') {
                                                 tagFound = 'X';
                                                 endXmlTagFound = 'X';
                                                 continue;
                        // <row> tag
                        if (payByteTemp<i> == '<') {
                             if (payByteTemp[i + 1] == 'r') {
                                  if (payByteTemp[i + 2] == 'o') {
                                       if (payByteTemp[i + 3] == 'w') {
                                            if (payByteTemp[i + 4] == '>') {
                                                 tagFound = 'X';
                                                 continue;
                        // </row> tag
                        if (payByteTemp<i> == '<') {
                             if (payByteTemp[i + 1] == '/') {
                                  if (payByteTemp[i + 2] == 'r') {
                                       if (payByteTemp[i + 3] == 'o') {
                                            if (payByteTemp[i + 4] == 'w') {
                                                 if (payByteTemp[i + 5] == '>') {
                                                      tagFound = 'X';
                                                      continue;
                        if ((payByteTemp<i> == '>') && (tagFound == 'X')) {
                             tagFound = ' ';
                             continue;
                        if (tagFound == ' ') {
                             if (endXmlTagFound == 'X') {
                                  continue;
                             payByteOut[actualCount++] = payByteTemp<i>;
                   byte[] payByteExp = new byte[actualCount];
                   System.arraycopy(payByteOut, 0, payByteExp, 0, actualCount);
                   payload.setContent(payByteExp);
                   msg.setDocument(payload);
                   inputModuleData.setPrincipalData(msg);
              } catch (Exception e) {
                   ModuleException me = new ModuleException(e);
                   throw me;
              return inputModuleData;

  • Different Attachment extension(.xls,.txt) in sender mail adapter

    Hi Experts
    Is it possible to use different type of attachment extension (e.g .xls,.txt) in the sender mail adapter?
    My requirement is , the attachment in the mail adapter will be used as the main payload.So I am using PayloadSwapBean adapter module.
    Currently I am using the following module key for .xls attachment and it is working.Configuration for .xls attachment is as follows
    swap.keyName-Content-Disposition
    swap.keyname-Content-Description
    swap.keyName-Content-Type
    swap.keyValue-attachment;filename="MailAttachment-1.xls"
    swap.keyValue-MailAttachment-1
    swap.keyValue-application/vnd.ms-excel.
    Now, the attachment may be .xls or .txt file.
    Now If I want to use .txt atachment then do I need to define all these parameter again and in that case what will be my content type for .txt file.
    Your inputs required
    thanks
    Ayan

    PayloadSwapBean  will only convert the attachment as the main payload.
    Yeah for reading excel file I have a separate custom adapter module.This is not in the scope of my question..
    All I am asking , can .txt as well as .xls attachment be used in the same sender mail adapter.
    If that is possible what will be my content-type for .txt or can I remove content-type and use only content-disposition and content-description so that any type of attachment it can recognise.
    The momment I am specifying  content-type , I am making it particular  that only say .xls attachment , it will identify.
    I hope I make you clear.Inputs required
    Thanks
    Ayan

Maybe you are looking for

  • Problem on delete statement in JSP

    org.apache.jasper.JasperException: An exception occurred processing JSP page /proj/AdminLog.jsp at line 130 127: Driver Driverrs3 = (Driver)Class.forName(MM_Conn_DRIVER).newInstance(); 128: Connection Connrs3 = DriverManager.getConnection(MM_Conn_STR

  • WWV_FLOW_DATA growing very fast

    Hi, We have a public application and we see wwv_flow_data growing very very fast (Up to 5Gb now). In a way, this is a good sign ;) this means that we have a lot of hits... but we are also starting to see some contention on that table. It would be nic

  • Employees Salary Expenses

    Hi, Please clear the following doubt: 1. Employee salary booking in FI (without HR module)????  How should we do the entry??  Only consolidation entry, for diff. expenses under salary. (assume that no employee accounts are created in AP). 2. Is it po

  • Error in FEBA- Electronic Bank Statement.

    Hi Experts, We are facing a problem with FEBA and the issue is as described below; 1. User has uploaded the Bank File using FF_5 and it got uploaded correctcly. 2. In FEBA i could see that the items/line items are marked a posted and even the documen

  • G5 Firewire problems

    I just bought a quad 2.5 G5. When I have my hard drive hooked up though my firewire 800 port, it will not recognize my camera hooked up though my firewire 400 port - front of back ports. If I plug my camrea up first -again front or back firewire 400-