PayloadZipBean

I read about the PayloadZipBean (adapter module) and have a question about it that is not answered in /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
I don't have an XI system with SP19 so I cannot test it by myself.
I have a zip file that contains multiple xml documents. Is each xml document extracted and send to the integration engine as a separate message? Or is it only possible to have one file in the archive?
(The first option is what I need!)

All xml documents in the zip together as one message? Each xml document has a root object... and as far as I know any xml cannot have more than one root element. So how would the arriving message in XI look like? How the files would be aggregated to one message? Can anyone explain it in more detail?
Or did you mean each file as one message (one message per file contained in the archive)?

Similar Messages

  • PayloadZipBean - variable filename inside the archive

    Hi,
    I'm using the Adapter-Specific Message Properties in a sender fileadapter to determine the incoming filename, which has variable components (i.e. date and time). After changing the prefix and suffix in a Message-Mapping the new name is applied in a receiver fileadapter. The new name is now part of the payload in the tag <Filename>. The receiver fileadapter contains the PayloadZipBean to compress the output file, everything works fine.
    Now I want the file inside my compressed archive always to have the same name as my archive has. In Stefan Grube's blog about the PayloadZipBean I only found the possibility to choose a fix name by using the MessageTransformBean (name="file.txt").
    Example:
    1. variable input filename:                       IN_RNK_20080227_1006.txt
    2. filename after Message-Mapping:        OUT_RNK_20080227_1006.gz
    3. archive filename after receiver adapter: OUT_RNK_20080227_1006.gz
        filename inside the archive:                 MainDocument (this is the default (payload-name))
    I would like to name the file inside the archive OUT_RNK_20080227_1006, too.
    Question 1: Is there any possibility to read out the mapped <Filename>-tag from the payload to use it for the element inside my archive (File Name Scheme and Variable Substitution don't work when using Adapter-Specific Message Properties).
    Question 2: Is there a way to modify the name of the payload so that I can change "MainDocument" to "OUT_RNK_20080227_1006"?
    I'm on XI 3.0 - SP19.
    Many thanks,
    Ralph

    >
    Stefan Grube wrote:
    > In this thread there is a module for reading the content type and setting the dynamic configuration:
    > sender mail adapter - attachment name
    > It should be not be so difficult to derive the reverse way
    Thanks for this info Stefan.
    [Stefan Grube's webinar on custom adapter module development|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/64a6bdab-0c01-0010-079a-b3707717cecd?prtmode=navigate]
    The code of the EJB module we had to write to get the filename from the Dynamic Configuration (ASMA) and then set the content type of the message is given below.
    * Created on Apr 23, 2008
    package zfilezipper;
    * @author Krishneel Goundar
    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.*;
    * @ejbHome<{com.sap.aii.af.mp.module.ModuleHome}>
    * @ejbLocal<{com.sap.aii.af.mp.module.ModuleLocal}>
    * @ejbLocalHome<{com.sap.aii.af.mp.module.ModuleLocalHome}>
    * @ejbRemote<{com.sap.aii.af.mp.module.ModuleRemote}>
    * @stateless
    public class SetContentTypeEJB 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{
              try {               
                   Message msg = (Message) inputModuleData.getPrincipalData();     //Used to read dynamic configuration data
                   TextPayload payload = msg.getDocument();     //Used to set 'contentType' value
                   //The name of the file to be zipped is read from the dynamic configuration.
                   String fileName = msg.getMessageProperty("http://sap.com/xi/XI/System/File", "FileName");
                   if(fileName == null)     //If no file name can be determined we set 'contentType' to "defaultbeanile.txt"
                        payload.setContentType("text/plain;charset = \"UTF-8\";filename=\"defaultbeanfile.txt\"");     
                   else     //If a file name can be found we set 'contentType' to the name of the file.
                        payload.setContentType("text/plain;charset = \"UTF-8\";filename=\"" + fileName + "\"");     
                   //After setting the value of 'contentType' we need to update the ModuleData object (inputModuleData).
                   inputModuleData.setPrincipalData(msg);
              } catch (Exception e) {
                   ModuleException me = new ModuleException(e);
                   throw me;
              return inputModuleData;          //Return the updated ModuleData object.
    Edited by: Charu Kulkarni on Apr 28, 2008 1:41 AM

  • Unzip file using PayloadZipBean in Sender FILE adapter

    I am trying to unzip a flat file in Sender FILE adapter using PayloadZipBean.
    I am getting mapping error. The problem is File adapter is reading data without unzipping. I am getting weird characters/data, so mapping error.
    I searched all the blogs/ forum threads and help.sap.com, everywhere the focus is on zipping, not unzipping.
    the file I have is with .gz extension, but I tried with .zip extension also.
    Please help in resolving this issue.
    Edited by: Gopal Janagama on May 2, 2008 11:42 PM

    Gopal,
    GZIP and ZIP format are slightly different, as stated here :
    "GZIP compresses only one file and does not have a header. ZIP contains header information about what files are contained in the file."
    So I'm not sure the PayloadZipBean supports GZIP format ... Try to ungzip and then zip its content and see if the bean works for it
    Rgds
    Chris

  • Controlling filenames using PayloadZipBean

    Hello
    I am struggling with names of the zipped files using payloadzipbean. The Scenario is as follows: we want to transfer an invoice including attachments to an external partner consisting of an xml message and one or more pdf files as attachments. the attachments are added to the message in an ABAP proxy on the sending R/3 system. The message is transferred to PI,where it si routed to an ftp communication channel. The xml message is zipped using the payloadzip bean and transferred to the external partner using ftp. The partner requires an approriate file extension to identify the types of files on the receiving side. Originally we managed this pay using the parameter zip.filenameKey and set it ContentType. The files inside the zip file are then named "untitled.xml" for the xml message and "untitled.pdf" for the attachments. However when there is more than one attachment the zipping of the file crashed, as both attachments have the same filename. We can fix this by adding an unique name to the attachment when it is attached to the proxy, and changing the zip.filenameKey to payloadName. The problem then is that the main payload file is called MainDocument without the .xml extension. I need to change the name of the payload or find another way to make the attachment filenames unique with zip.filenameKey set to ContentTyoe, Any suggestions ?
    Eivind Langsæter

    it is a bit tricky.
    You might have to code a module to build the attachments and then use zipbean to zip it for you.
    to set the name of the main document you can have a look into the sinppet of code below;
    Vector_attachementFileName contains the name for the attachment
    attachmentFileMainPayload has the data of the main payload
    XMLPayload MainDocumentPayload = message.createXMLPayload();
            MainDocumentPayload.setContent(
              this.attachmentFileMainPayload.getBytes());
            message.setDocument(MainDocumentPayload);
            Audit.addAuditLogEntry(
              this.auditMKey,
              AuditLogStatus.SUCCESS,
              "Main Document Successfully Set");
            TextPayload txtpayload = message.getDocument();
            txtpayload.setContentType("text/plain");
            txtpayload.setName(
              this.Vector_attachementFileName
              .elementAt(lengthOfVector - 1)
              .toString());
            Audit.addAuditLogEntry(
              this.auditMKey,
              AuditLogStatus.SUCCESS,
              "File Created: " +
              this.Vector_attachementFileName
              .elementAt(lengthOfVector - 1)
              .toString());

  • Error Archiving File in File Sender Adapter using AF_Modules/PayloadZipBean

    Hi everybody.
    I have to pick a zip file up from ftp server, unzip an convert the file in xml.
    Im using this modules in file sender adapter:
    AF_Modules/PayloadZipBean --> To unzip de file
    AF_Modules/MessageTransformBean --> file to xml
    The problem is when I try to archive de file. Im getting this error and I dont know why (This path exists /out/ProcesadosSinError/)
    Could not archive file 'test.zip' as '/out/ProcesadosSinError/20100518-091029-155_test.zip' after processing: java.io.FileNotFoundException: /out/ProcesadosSinError/20100518-091029-155_test.zip (A file or directory in the path name does not exist.)
    Could it be that is not possible to archive with AF_Modules/PayloadZipBean?
    Thank u so much

    Hi Stefan.
    Absolutely. This path exists. It's an absolute path from root. I can´t understand the error!!!!
    Thanks!!!
    Edited by: Christian  Abad Chico on May 18, 2010 9:35 AM

  • PayloadZIPBean with Mail Package... is it possible?

    Hi,
    In proxy to file scenario, I send mails from PI with data received from proxy as attachment. I also need to zip the attachment.
    I will be getting the email address dynamically, hence I should use Mail Package with 'Keep Attachments' option. Now the problem is if I use mail package since the <content> tag data is taken as mail attachment, can I use PayloadZipBean in receiver mail adapter to zip the attachemnt?
    I tried using the follwoing adapter module in receiver mail mail adapter but ended with an error.
    Module Name: AF_Modules/PayloadZipBean                             Module Key: zip
    Module Config:
    zip             zip.filenameKey                   payloadName
    zip             zip.mode                              zipOne
    Error:
    org.xml.sax.SAXParseException: Content is not allowed in prolog
    Regards,
    Sreedhar

    Hi Sreedhar,
        Have you looked at this help link?
    http://help.sap.com/saphelp_nwpi711/helpdata/en/45/da9358a1772e97e10000000a155369/content.htm
    Also see :
    Zip Payload using PayloadZipBean Module Processor
    Regards,
    Ravi Kanth Talagana
    Edited by: Ravi Kanth Talagana on Oct 22, 2009 5:13 PM

  • Unzip using PayloadZipBean

    Hi,
    I was looking to use PayloadZipBean module to unzip a zipped file with three text files inside.
    From the receiver adapter Audit log files, I see that the PayloadZipBean,is unzipping all the three files(first file as main payload and rest of the two files as additional payloads), but while writing the files, it only writes one file with the Main Payload content and the file name from File Name Scheme parameter.
    In module configuration, i gave name as zip.mode and value as unzip. Are there any other parameters where we can specify the names for additional files and also how do we extract other two files.
    Already looked at 'SAP Note:965256 - XI 3.0 Adapter Framework Zip Module' where not much information is available on unzipping piece.
    Thanks in advance.
    Pradeep

    I dont think you can use all the unzipped files as payloads. You might want to crate two scenarios where it writes all the unzipped files to disk (using receiver file adapter) then another file to X scenario as per your requirement.
    VJ

  • PayloadZipBean in SFTP sender adapter

    The senario is : the sender channel uses the ZIP module. The sender and receiver adapters are SFTP and there is no Message mapping. The sender channel zips the text file. However the Sender cahnnel is green is Communication cannel monitoring but fails at  SXMB_MONI with error message  "No interface determination found for outbound interface XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX: Error while determining root tag of XML: BOM / charset detection".
    Configuration module tab in sender channel corresponding to PayloadZipBean module:
    zip     zip.fileNameKey     Content-Type: text/plain; name="name.txt"
    zip                zip.mode                           zip.
    Please advice.

    1) why dont you use the zip module on the Receiver channel?
    2) if sender is doing a zip, the payload (message) wont match with that of the one in your interface (SI/ MI)

  • 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.

  • PayloadZipBean for nested zip files

    Hi,
    My scenario is file (zip) to file (unzip).
    Zip file contains one parent folder, parent folder has 6 nested folders and each folder contains 12 files. (all the 12 files are .jpg and .tif files). Few folders contains the same file as well, like A00001.tif in two folders.
    Using PayloadZipBean, I have extracted all the files in zip files, using PayloadSwapBean, I can able to swap the attachments and place it target folders. Using this method, I can be able to swap only one attachment. Also I should know the attachment name, to use it with PayloadSwapBean(Paramenters: swapKeyName and swapKeyValue)
    Is there any other method, that I can be able to extract all files in zipped folder and place it in the target folders in a single shot.
    I am planning to go for Custom Adapter Module development, but not sure how far this can be feasible. Any other idea is much appreciated.
    Thanks & regards
    UP

    Hi,
    >>>>Is there any other method, that I can be able to extract all files in zipped folder and place it in the target folders in a single shot.
    yes - unzip in OS command of the file adapter - this way you can unzip all files and push them via PI without the need for an adapter module,
    Regards,
    Michal Krawczyk

  • PayloadZipBean with customized zip filename

    Hi,
    I am using PayloadZipBean for zipping my XML payload, However i get zip file as expected e.g. rakesh_05_05_2010.xml.zip But inside this zip file i get MainDocument or untitle.txt based on zip.filenameKey setting as payloadName or contentType etc..
    Question : Is their any way by which i can get files named as rakesh_05_05_2010.xml wrapped in rakesh_05_05_2010.xml.zip ?
    i want to have embedded file name as zip file name without .zip.
    Please let me know how we can achieve this in SAP PI 7.0.
    Regards,
    Rakesh Mourya.

    Hi Mark,
    Yes, Shell Script on command line after file is created filename.xml.
    You need to be very careful in scripting ... you need to put some delay or wait time.
    Since file creation and availability of file on drive /folder take time and Shell script execution is very fast.
    You need to ensure you put sufficient amount of wait time depending on maximum size of xml or file you are creating else file will not be zipped.
    Hope it helps!!!
    Regards,
    Rakesh Mourya.

  • PayloadZipBean - Unzip not working

    Hi,
    Let me explain my scenario first, it is simple but not properly explained in many blog..
    I need to fetch a Zipped file( Input.zip), unzip it (contains a Input.xml file ) & map, send it to another file server.
    In my Sender CC I have added the following in modules
    AF_Modules/PayloadSwapBean  Local Enterprise Bean Transform
    AF_Modules/PayloadZipBean      Local Enterprise Bean Unzip
    CallSapAdapter                          Local Enterprise Bean  0
    Transform                                  swap.keyName           payload-name
    Transform                                  swap.keyValue           attachment;filename="Input.xml"
    Unzip                                        Unzip.Mode                unzip
    Source Directory in Sender CC points to zip file
    My expectation is that, a new attachment is created during unzip, it is pointed as payload because of PayloadSwapBean.
    After executing, it shows parser error in sxmb_moni, when I click the payload in in sxmb_moni, a popup comes asking me to save the zip file, it proves that the file is not unzipped & attached as new payload.
    Need your help .
    Thanks,
    Sridhar

    Hi Stefan,
    Your suggestion looks good, when In checked in SXMB_MONI under payload
    it showed MainDocument(application/xml)...when I clicked it asked 'Do you want to save the file' & showed the file name as  25c4850_1827HTML000007, file type as WinRAR ZIP archive...
    Do you want to use this has file names ?
    moreover I think the  25c4850_1827HTML000007 will change if I try to execute again ...
    Can you clarify me ?
    Thanks,
    Sridhar

  • Zipping multiple Payloads to single Zipfile using payLoadZipBean

    Dear Friends,
    Can you help me in doing this sceanrios:
    I'm trying to send multiple payloads from source (selection
    of multiple payloads is done by checking Advance selection for
    Source file)  to PI, that inturn Zip all Payloads in to a single Zip FIle.
    (note: payLoadZipBean is giving individual zip file for every single payload but I want it all in single Zip file)
    And also can I zip, Additional Files sent through File Adapter,
    as these are not considered as payloads. Plz correct me If I'm wrong.
    I request you plz dont paste any links to blogs or forums.
    I'm trying to create a module to perform this scenario,plz suggest me better answers, in case module develpment is not required.
    Dear Stefen, I hope I will get a good answer from you soon.
    And thanks for suggesting me to post a thread for this issue.
    Thanks in advance
    Praveen K Kurni

    Dear Sameer,
    I did studied the SAP note;
    By using these parameters
    Module Key: zip
    Parameter name: zip.mode
    Parameter value: zipAll
    Module Key: zip
    Parameter name: zip.filenameKey
    Parameter value: contentType
    Module zips all payloads as individual zipfiles
    for ex:
    my files are:
    1. abc1.xml
    2. abc2.xml
    3. abc3.xml
    module payLoadZipBean zips these payloads as
    1. abc1.zip
    2. abc2.zip
    3. abc3.zip
    But I want all the files to be zipped in to single zipped file:
    let say abc_all.zip
    Thanks any way
    Praveen K Kurni

  • Error while using PayloadZipBean module

    hi,
    For sending the data in zipped format in JDBC Adapter i used "PayloadZipBean" module.
    While Communication channel Monitoring at Receiver end I am getting this Error:--
    "Message processing failed. Cause: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at loacalejbs, the whole lookup name is localejbs/loacalejbs/AF_Modules/PayloadZipbean."**
    Is there any need to write this module in adapter engine?

    Hi,
    Have a Look at these
    Working with the PayloadZipBean module of the XI Adapter Framework
    Zip-Transfer-Unzip: Increase the performance of your Java-ABAP applications
    Regards
    Seshagiri

  • Zip Payload using PayloadZipBean Module Processor

    Hi,
    I'm using AF_Modules/PayloadZipBean in module processor of Receiver SOAP adapter to compress/zip the message payload. I've used the following module key parameters :
    Parameter Name      Parameter Value
    zip.Mode                  zipAll
    zip.filenameKey        contentType
    In the adapter engine monitoring from RWB I can see the following warning message :
    Warning Zip: message is empty or has no payload
    But I can see the msg payload from the RWB message monitor as expected.
    Can anyone please throw any light on this issue?
    Thanks in advance,
    Dipankar

    Hi Stefan,
    Can you please explain what you meant by transfer-encoding gzip?
    Actually the requirement is to receive xml message in compressed zipped  format along with digital signature. As I understand using the ModuleProcessor which you mentioned in your blog I can send zipped message (using File Adapter I've actually achieved the result as mentioned in your blog. So thanks a lot for that!). But in file adapter I can't use digital signature. So how to satisfy both the requirements using a single adapter (and maybe using some module processors over it)?
    Thanks for your help!
    Dipankar

  • Problem using payloadZipBean to unzip a file

    I would like to run OS command to zip large amount of xml into one zip file before XI pick it up, then use unzip option in payloadZipBean to unzip all the xml files so XI can process them one by one from memory, this will reduce lots file I/O time.
    But I am getting this warning message:
    Warning Zip: message is empty or has no payload
    But if I display this message in RWB, the only payload is this zip file.
    Why the payloadZipBean is not unzipping this file as supposed to.

    Did you check this blog
    /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
    Sameer

Maybe you are looking for

  • Need to convert a string to boolean

    i have string true, false, i need to convert them to boolean, is it good to use String.equals(true/false) or is it good to use Boolean.valueOf(true/false) Regards, Surya

  • How to add Freight Charges for SO Via B1WS

    I am using B1Ws for adding a new Sales Order. I want to enter Freight Charges details also. In DIAPI through expense code we can add but in b1ws what is the equivalent of that ? Can anbody guide me ? Thanks Vaithy

  • Issue in SNP optimzer

    Hi, Our scenario is the product P getting manufactured at locations X and Y. Now same demand present on both the locations and we want to identify where to produce how much using optimizer. Im currently exploring optimizer and trying to build up the

  • Action Link

    Experts, I am using an Action Link for navigating from Analytics to Siebel record. I dont know why the link for drilling down is not appearing.Static value is appearing.How to get the link so that I can drilldown to Siebel record. thx, parag

  • Two BW system to one OLTP system connection issue.

    We are upgrading our BW systems to BI 7.0. We are planning for a parallel Break-fix path. so we made a copy of our BW dev system(BW1) BW2 is a copy of BW1 and plan to upgrade it to BI 7.0 .we plan to retire BW1 after upgrade is completed. When we try