Zip module in mail adapter

Hi,
I have proxy -> mail scenario and I have to use PayloadZipBean to zip mail attachment.
I dynamically set from, to, subject, etc fields so I have "Use Mail Package" and "Keep Attachments" checked.
When I unchecked "Use Mail Package" option I receive mail with zip file.
Is it possible to use zip module and mail package together?
How can I do it?
I tried many options but without success.
In configuration in Module tab I have PayloadZipBean and XIMailAdapterBean
and zip.filenameKey -> contentType and zip.mode -> zipOne
but channel is returning error:
Mail: error occured: 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: XMLParser:
No data allowed here: (hex) 50, 4b, 3(:main:, row:1, col:3)(:main:, row=1, col=3) ->
com.sap.engine.lib.xml.parser.ParserException: XMLParser
: No data allowed here: (hex) 50, 4b, 3(:main:, row:1, col:3)
What I am doing wrong?
Best Regards,
Przemek

Hi Przemek,
>>Do you suggest to create zip file from content field in XSLT mapping. Could you write something more about this option or provide example?
What I meant was the XML generated fromt he MailPackage will have the content in the COntent field. Now when you say about zipping the payload, it should be this content. Right?
Though I have never tried but would have used the following test
1. I would try to take the value in the Content field of the ouput XML. For this either java module of XSLT code will be used.
2. Once I get the content I would have used SoapPayload and PayloadZipBean and try to zip the [ayload
But again this is just an idea from my end, since I have not tried I am not sure about the feasibility
Regards
Suraj

Similar Messages

  • Modules in Mail Adapter

    Hi
    I have read the PDF attachment from the mailbox. Hence i have to create a PARSER in the Netweaver developer studio. But i cannot see the perpective in the same. AM using SAP NetWeaver Developer Studio - Version: 2.0.3. Please tell me if i need to update the version.
    Regards
    Andy

    Anandan-
    You can use a mail adapter with a custom module. Check https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3bdc14e1-0901-0010-b5a9-a01e29d75a6a
    for creating your own adatper modules
    For reading from PDF, you can use the classes provided by SAP/ADS. I wrote a blog for reading the PDF using an external utility (check /people/sap.user72/blog/2005/07/31/xi-read-data-from-pdf-file-in-sender-adapter) but would suggest you to use the class provided by SAP.
    You might also try Conversion Agent, a third party utility but it comes with a license fee.
    Hope this helps.
    KK

  • Modules for mail adapter

    I want to remove attachments from the emails i send out of PI,
    is there any modules for this purpose?
    by default if i chck: msg protocol as XIALL i get entire messge as an attachment, even if i select XIPAYLOAD i get the payload as an attachment,
    i only want to have the body and not the attachment.
    Is there any adapter module readily available to remove attachments from emails?

    i only want to have the body and not the attachment.
    Choose these in your Receiver Mail Adapter:
    Message Protocol :XIPAYLOAD
    Check Use Mail Package
    enter the appropriate URL
    No need to check other options...
    Using this you cannot enter From, To, Subject and other such fields in the channel....these should be configured in the mapping.....unless it is Parameterized mapping (applicable only to SAP PI7.1)
    Regards,
    Abhishek.

  • How to remove a Attachment in Module for Mail Adapter

    Hi together,
    we are trying to remove a Mail Attachment within a outgoing Mail with the help of a new Module executed by the Mailadapter. Since we are using the XI 3.0, we are trying to do that by this statements:
          Message msg = (Message)inputModuleData.getPrincipalData();
          Iterator it = msg.getAttachmentIterator();
          Payload payload;
          do
                payload = (Payload)it.next();
                if(payload.getName().equalsIgnoreCase("MailMessage"))
                      it.remove();
          }while(it.hasNext()); ...
    The statement "it.remove" doesn't work.
    Does anyone have an idea, how we can remove the attachment?
    Thanks & Regards
        Thomas

    I am sorry, the adapter module API does not support the removal of an attachment.
    Regards
    Stefan

  • Split module usage in mail adapter

    hi,
         Can anyone explain whts the usage of Splitmail module in mail adapter?
    The Scenario for the  interface is IDOC to Mail.
    IDOC is transformed by XI and mapped to a target message, and then it
    is send as a mail with file attachment to various customers via the
    MAIL Adapter
    I am getting an error in Mail Adapter(exception caught with cause com.sap.engine.services.ejb.exceptions.BaseTransactionRollbackLocalException)
    1. Iam using the follwing beans in the moduletab localejbs/SplitMail, localejbsMailContent for the conversion of idoc data records to receive in the mail server as an attachement.
    <b>(Note :My interface was working fine before patch Upgrade, after the patch upgrade its not working plz suggest)[
    /b]regards
    chaithanya

    hi all,
           <b>The error appears again in Mail Adapter(exception caught with cause com.sap.engine.services.ejb.exceptions.BaseTransactionRollbackLocalException)</b>
    , can anyone suggest wht exactly the splitmail bean does (is it sap-provided bean or can we define our own bean with specific features like i want payload data & body content in mail adapter to be visible ).
    <b>The Scenario for the interface is IDOC to Mail.
    IDOC is transformed by XI and mapped to a target message, and then it
    is send as a mail with file attachment to various customers via the
    MAIL Adapter</b>
    The above discussed content is I should receive mail in the mail server as an attachement(which consists of idoc data) , in the body of the mail it should be the
    text with 2  or 3 lines.
    Regards
    Chaithanya

  • How to send meeting request by mail adapter

    Hi,
    I'm doing scenario from file to mail. I have a sender file adapter to pick up the meeting request standard format file(*.ics) from file system. On the other side I have a receiver mail adapter to send mail. What I want to do is the sent mail by mail adapter should be a meeting request instead of a normal email with meeting request as its attachment.
    I use localejbs/AF_Modules/MessageTransformBean as first module in mail adapter, but the sent mail is also a normal with meeting request as its attachment. This is not what I expected.
    I also created own module for mail adapter to realize it. Do I need to change the format of meeting reqeust information in payload? Actually I have chance to do it in module. But what should I do? Thanks.

    Hi, Krishna:
    Thanks for your reply.
    Actually the content of ics file is like:
    BEGIN:VCALENDAR
    PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
    VERSION:2.0
    METHOD:REQUEST
    BEGIN:VEVENT
    ATTENDEE;CN="Wu, Oscar";ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:[email protected]
    ORGANIZER:MAILTO:[email protected]
    DTSTART:20070626T130000Z
    DTEND:20070626T150000Z
    LOCATION:Shanghai
    TRANSP:OPAQUE
    SEQUENCE:0
    UID:040000008200E00074C5B7101A82E00800000000F067E9BB0DB8C7010000000000000000100
    00000C7423D530FE8744687B0C7C08D4CAA58
    DTSTAMP:20070626T104913Z
    DESCRIPTION:Meeting request without attachment\n
    SUMMARY:Test appointment
    PRIORITY:5
    X-MICROSOFT-CDO-IMPORTANCE:1
    CLASS:PUBLIC
    BEGIN:VALARM
    TRIGGER:-PT15M
    ACTION:DISPLAY
    DESCRIPTION:Reminder
    END:VALARM
    END:VEVENT
    END:VCALENDAR
    this content is content of meeting request based on RFC 822, what I want is not get the content itself in mail, I want the mail adapter send a meeting request out automatically when it get this content.
    Thanks

  • Rename the zip file and send it using the Receiver Mail Adapter

    Hi,
    We have a custom module that will create multiple attachments. The result is then passed to the PayloadZipBean, which zips as per required.
    When we output this to a file adapter, we provide the file name as say "zippedfile.zip" the result is as expected.
    For example, if the custom module created 3 attachments with the names as file1.txt, file2.txt and file3.txt, the zip file zippedfile.zip, will contain 3 files as file1.txt, file2.txt and file3.txt.
    The issue that we are facing is when we use the mail adapter, the zip file is getting renamed to file1.txt.zip i.e to say that it takes the name of the main payload from the custom module (file1.txt)
    TextPayload txtpayload = message.getDocument();
    txtpayload.setContentType("text/plain");
    txtpayload.setName("file1.txt");
    moduleData.setPrincipalData(message);
    We tried using the MessageTransformbean but it doesn't seem to change the name of the file.
    Not sure where we are going wrong. Is it that the output of the payloadzipbean cannot be used and altered by MessageTransformbean?
    Is there any alternative as to rename the name of zipfiles and use it in the mail adapter?
    Appreciate any help on this regard.
    Regards,
    Shabz

    Solved.
    use Transform.ContentDisposition - attachment;filename="youfilename"
    Do read the mail adapter FAQ.
    The parameter can vary for different mail client.

  • Does Sender Mail Adapter support "PayloadZipBean" module

    Hi everyone,
    I have a scenario where, I get the email with an zip file as an attachment and I need to extract this file and send across. There is no mapping transformation done here, only I need to forward the attached file to the file server.
    Zip file always contains 1 file and is a text file.
    so Its an Email to File Scenario.
    Can I send the zip file as it is without unzipping i.e., send the attachment as iit is to the file server?
    If I want to unzip the file, does the module "PayloadZipBean" support in case of sender mail adapter. ?
    Thanks,
    Varun

    Hi Varun,
    Use "PayloadZipBean " Module at Receiver Communication Channel  in the Module Tab Set the "Module Key.mode =  unzip"
    and Receiver communication Channel file should be "FileName.txt".
    http://help.sap.com/saphelp_nw2004s/helpdata/en/bd/c91241c738f423e10000000a155106/frameset.htm
    Regards,
    Naga.

  • 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

  • Multi Attachments with ZIP or Mail Adapter (Outbound)

    Hi,
    is it possible to process one message with several attachments?
    I am thinking of a use in the Mail Adapter if you get several attachments or if you have one ZIP File with several documents. I would process the ZIP File in a Module and add each document as attachment.
    But how can I process then the different attachments? PayloadSwapBean is only for one file, right?
    Is it possible to produce during one Module Processing different messages?
    Thanks
    Philipp

    Hi,
    >>>>>is it possible to process one message with several attachments?
    of course it is
    >>>>But how can I process then the different attachments?
    you can add them in the adapter module for example
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Change "subject" in Receiver Mail Adapter Module

    Hi all,
    following the "How To Guide" I developed a Module for my receiver mail adapter. Everything works fine.
    Now my question: is it possible to change the content of the mail-"subject" in the module?
    Your help is appreciated.
    Carmen

    Hi Stefan,
    maybe I should describe my problem more detailed:
    My scenario is RFC-XI-Mail. I use the mail package to determine the receiver of the mail dynamically. Another thing I want to do, is to attach a file to this mail which is located on the server. So far so good.
    My problem is, that the name of the file (which I need in my adapter module) changes for every mail. So what I need is the possibility to deliver it to the adapter module.
    I found out that it is possible to read the payload. So my idea was to hand it over in one of the fields like "subject". But now I want to change the subject afterwards...(delete the filename).
    Maybe you have another idea?
    Regards
    Carmen

  • Remove Attachment in Mail Adapter Module

    Hi!
    My problem: I get an email with an attachment which I process in an adapter module for the mail adapter. With the resulting XML I set a new payload, but the old attachment still exists.
    This gets to a problem when I route the message back to the mail adapter, he adds the old attachment to the generated email. Therefore the new email has two attachments: the old one and the new one, which should only be one attachment: only the new one.
    How can I remove the old attachment? I found no function which solves this problem.
    Best regards,
    Daniel

    Hi Michal,
    thanks for the link.
    When I import aii_proxy_xirt.jar in my NWDS, I can import the MessageSpecifier class. But I can't get an instance of it from the classes which I can access.
    The only 'documented' usages of this class I found were codings for java proxies, so I'm not sure we can use this class in an adapter module.
    In this cases they get the MessageSpecifier instance from the proxy bean, so maybe we can get it from the EJB, but this doesn't work with an adapter module (or I haven't found out how )
    Hmm. It is a simple problem, but it seems difficult to solve
    Best regards,
    Daniel
    Message was edited by: Daniel Himmel

  • Mail adapter and MessageTransformBean module configuration issue

    Hi All,
    I am trying to use module configuration in Receiver Mail adapter. Below is my configuration. (We are using SAP PI 7.11)
    Parameter/General tab:
    Message Protocol : XIPAYLOAD
    Use Mail package option is selected.
    Content Encoding = none
    Module tab:
    Processing Sequnce:
    AF_Modules/MessageTransformBean  : XSLT
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean : mail
    Module Configuration:
    XSLT    Transform.Class                        com.sap.aii.af.sdk.xi.adapter.XSLTConversion
    XSLT    Conversion.XSLTFileName     /tmp/GL_POST_RESPONSE_EMAIL.xsl
    XSL works outside of PI . However, when i test with a message, I am seeing following errors in Runtime workbench:
    Please let me know what could be wrong in the above configuration
    23.03.2011 15:24:39 Information MP: processing local module localejbs/AF_Modules/MessageTransformBean
    23.03.2011 15:24:39 Information Transform: using Transform.Class: com.sap.aii.af.sdk.xi.adapter.XSLTConversion
    23.03.2011 15:24:39 Error Transform: Transformer Conversion1.0.0610 Error initializing XSLT Mode:; caused by javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
    23.03.2011 15:24:39 Information Transform: transforming the payload ...
    23.03.2011 15:24:39 Error Transform: failed to execute the transformation: com.sap.aii.af.sdk.xi.adapter.trans.TransformException: Error converting Message; nested exception caused by: java.lang.NullPointerException: while trying to invoke the method javax.xml.transform.Templates.newTransformer() of an object loaded from local variable templates
    23.03.2011 15:24:39 Error MP: exception caught with cause com.sap.aii.af.sdk.xi.adapter.trans.TransformException: Error converting Message; nested exception caused by: java.lang.NullPointerException: while trying to invoke the method javax.xml.transform.Templates.newTransformer() of an object loaded from local variable 'templates'
    23.03.2011 15:24:39 Error Adapter Framework caught exception: Error converting Message
    23.03.2011 15:24:39 Error Delivering the message to the application using connection Mail_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.af.sdk.xi.adapter.trans.TransformException: Error converting Message; nested exception caused by: java.lang.NullPointerException: while trying to invoke the method javax.xml.transform.Templates.newTransformer() of an object loaded from local variable 'templates'.

    Hi All,
    Issue has been resolved. There was some minor issue in the XSL. The XSL Stylus studio was not reporting this as an error. However PI's XSL engine was reporting that error. This error message was not showing up in runtime workbench. However, when i looked at the default trace, there were few more errors. After fixing the XSL, I am able to received the email
    Thanks
    -Pradeep

  • Mail adapter module  UTF-8 to ISO-8859-1 conversion

    Hi!
    I've a problem with a mail attachment which is generated by an adapter module for the mail adapter. The content type is set to "Application/EDIFACT; charset=iso-8859-1" when I add the attachment, but the mail adapter ignores the charset-setting.
    Therefore german "umlauts" like ü are displayed in a wrong way: ü
    When I set the content, I transform it in ISO-8859-1 : attachment.setContent(edifactString.getBytes("ISO-8859-1"),"ISO-8859-1");
    When I test the result of edifactString.getBytes("ISO-8859-1"), I get the String in the right character encoding, but the mail adapter seems to "fix" the encoding
    I also tried to use the messageTransformBean, but it doesn't worked.
    Anyone knows how to solve this issue?
    Best regards,
    Daniel

    Hi all!
    I found a solution for this problem: First I used the TextPayload-Object for the Attachment which should be added. It seems that the TextPayload-Object has some bugs handling different encodings (handels only Unicode and deletes the charset=... setting from the ContentType).
    When using the Payload object for the attachment (which handles binary data), there is no conversion to Unicode, so I get my attachment as desired (but still without the charset-setting).
    Best regards,
    Daniel

  • Mail Adapter Module Problem!

    Hi All
    I m facing a problem in implementing a custom mail adapter module.
    The scenario is to set the content type based on the file type. eg: if the file being sent is a pdf then content type should be "application/pdf".
    I hope the scenario is clear, please feel free to ask for clarifications.
    awaiting your replies.
    Regards
    Kapil

    Hi All
    I am able to fetch the file name now and set the content type based on the file name. But I m not able to change the name of attachment of mail. For reference, I m pasting the code here, please suggest how to do the latter part
    try {
                         // CS_GETCHADAT START
                         cid  = moduleContext.getChannelID();
                         Channel channel = new Channel(cid);
                         // Example to access a channel configuration parameter in a module: String someParameter = channel.getValueAsString("YourAttributeName");
                         // CS_GETCHADAT END
                        fileName = msgg.getMessageProperty("http://sap.com/xi/XI/System/File","FileName");
                        Payload attachment = msgg.getAttachment("MainDocument");
                             StringTokenizer st = new StringTokenizer(fileName, ".");
                             while(st.hasMoreTokens()){
                                  extension = st.nextToken();     
                        Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "RenameFile: filename " + fileName);
                        Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "RenameFile: extension " + extension);
                             // create new payload
                             Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "RenameFile: attchmntName " + attachment.getName().toString());
                             //provide attributes and content for the new payload
                             attachment.setName("Attachment :" + fileName);
    //                         msgg.setMessageProperty("http://sap.com/xi/XI/System/File","content-description",fileName);
                             attachment.setContentType("application/" + extension );
                             inputModuleData.setPrincipalData(msgg);

Maybe you are looking for

  • Error in using tag library

              I am using Weblogic server 8.1 and have a struts app. I am using the random taglib           from jarkarta and recieving this error while using weblogic. With the same setup           in tomcat everything works fine. What do I need to do sp

  • Entry Point Not Found

    After updating itunes when i try to launch the application it comes up with an error message reading, "the procedure entry point AVCFURLAssetInheritURIQueryComponentFromReferencingURIKey could not be located in the dynamic link library AVFoundationCF

  • 4.0.1 crashes now when you double click a file to edit in source monitor

    If I double click a file to watch it in Media Browser or in the project window premiere crashes. In fact the only way I can open a source window to set in and out points is if the clip is in the timeline. This makes editing with premiere almost unusa

  • PDF Version Issue

    I am having a major problem. I have to save a PDF back to verion 1.4 . Everytime I use pitstop to change the version it works correctly but when I save the file and re-open it the file is back to a higher version again. I went into Pitstop preference

  • How to extract the data into Excel / PDF from SAP

    Hi, We have spool number of a report output. We want to extract the data into Excel / PDF from SAP directly... Plz guide...