Zip file as a SOAP attachment problem

I have an application that sends a zip file as an attachment. I have the file stored on the server and before I send it, I delete and/or add some files in the archive. I use the zip util packages for the zip file editing. I encode it to base64 and then send it as an attachment using SAAJ.
On the receiving end, I decode it and write it out to disk. Winzip opens the file ok, but when I try to open individual files I get either corrupted data or wrong crc errors. Some files open ok.
For debugging right before I encode and send it, I write it out to a temp file. Using Winzip, I can open and access any file ok. When I compare this temp file with the response version, they match up. The file properties (size, compressed size, crc) match for those files I can't open.
I use the com.sun.mail.util.BASE64EncoderStream and com.sun.mail.util.BASE64DecoderStream classes for the base64 operations.
The errors are:
1) Warning: the size of the extracted file (570) does not match the uncompressed size (63) recorded in the zip file
or
2) Error: invalid compressed data to inflate
Any help would be greatly appreciated, or general advice for sending zips as SOAP attachments.

Would you mind, can u send the code pls...

Similar Messages

  • Converting html file into zip file and send email attaching zip file

    Hi Experts,
    I am trying to send email with attachment(html). Which contains more than 7MB. So, It is throwing an error like Size exceeded.
    So, Now i need to compress the data for less than 7MB.
    I decided to convert HTML File into ZIP File.
    Kindly suggest me to convert the HTML file into ZIP file and sending email with attached ZIP file.
    Correct answer rewarded,
    Thanks & Regards,
    N. HARISH KUMAR

    Hi Experts,
    *// HTML_TAB converting into ZIP File
       DATA  : zip_tool TYPE REF TO cl_abap_zip,
               filename TYPE string ,
               filename_zip TYPE string .
       DATA  : t_data_tab TYPE TABLE OF x255,
               bin_size TYPE i,
               buffer_x TYPE xstring,
               buffer_zip TYPE xstring.
    filename = text-007.                                                                          "'HTML_TAB
    *describe the attachment
       DESCRIBE TABLE html_tab LINES tab_lines.
       bin_size = tab_lines * 255.
       CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
         EXPORTING
           input_length = bin_size
         IMPORTING
           buffer       = buffer_x
         TABLES
           binary_tab   = html_tab.
       IF sy-subrc <> 0.
    *     message id sy-msgid type sy-msgty number sy-msgno
    *     with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    *create zip tool
       CREATE OBJECT zip_tool.
    *add binary file
       CALL METHOD zip_tool->add
         EXPORTING
           name    = 'FSSAI_MAIL.HTML'
           content = buffer_x.
    *get binary ZIP file
       CALL METHOD zip_tool->save
         RECEIVING
           zip = buffer_zip.
       CLEAR: t_data_tab[],bin_size.
       CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
         EXPORTING
           buffer        = buffer_zip
         IMPORTING
           output_length = bin_size
         TABLES
           binary_tab    = html_tab.
    Thanks & Regards,
    N. HARISH KUMAR

  • Sending an XML file as a SOAP attachment over axis 1_4

    Hi, Does anyone know any good tutorials for this?
    I haven't been able to find anything useful yet.
    Thanks
    ---actually found something useful
    http://www-unix.globus.org/mail_archive/discuss/2007/02/msg00037.html
    Message was edited by:
    ABC_SUN_

    Would you mind, can u send the code pls...

  • OSB - send file in email attachment in SOAP attachment

    Hi!
    I would like to send a file in email in SOAP attachment.
    I thought it would be a simple task, I will create a proxy service, which calls a business service. There is a routing action in proxy service to business service and after the rouiting there is a replace action, I replace the attachments variable with this:
    <con:attachment xmlns:con="http://www.bea.com/wli/sb/context">
    <con:Content-Type>application/pdf</con:Content-Type>
    <con:Content-Transfer-Encoding>base64</con:Content-Transfer-Encoding>
    <con:Content-Disposition>attachment; filename="Simple.pdf"</con:Content-Disposition>
    <con:body>{$attachments/ctx:attachment/ctx:body}</con:body>
    </con:attachment>
    I received the email, but i cannot open the document, because it is corrupted...
    Please, could someone help me?
    I can't find out the solution.
    Thanks!
    Viktor

    Hi Anuj!
    Thanks for your answer again! :)
    I tried the blog and I could send email with attachment. My problem is that I have to put the file content into the webservice body when i call the proxy service as a webservice. But I want to put the file into the SOAP attachment. So this is my scenario:
    1. the service counsumer calls the proxy service webservice and the service consumer (client) put the file into the request SOAP attachment
    2. the proxy service calls the business service
    3. the business service sends the email with an attachment (and the file is into this attachment)
    Could You help me?
    Thanks!

  • Need .ZIP file as an attachment in email

    Hi,
    I have developed a report which converts the ALV grid into a PDF and into .ZIP file. Finally ZIP file gets downloaded using GUI_download.
    My client wants the .ZIP file as a mail attachment but not as a download.
    Here is my final bit of code.
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          buffer        = zip_file
        IMPORTING
          output_length = bcot1
        TABLES
          binary_tab    = file.
        CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          bin_filesize = bcot1
          filename     = file_path
          filetype     = 'BIN'
        TABLES
          data_tab     = file.
    How to replace the Download with email? I tried using SO_NEW_DOCUMENT_ATT_SEND_API1 but I am not getting email. I also check in SOST for my transmission request but I ma not able to find my request.
    Edited by: Vjai.. on Sep 23, 2011 10:17 PM

    if your system > 4.6.  check this blog.
    /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abapversion-610-and-higherbcs-interface
    take care.
    Çağatay

  • ByteArrayInputStream as source for zip file entry corrupts the ByteArray

    Hi All,
    I have managed to create and add a (in-memory) zip file as an email attachment. I add a file to the zip file , then push data to this file via a ByteArrayInputStream.
    Adding the file (created via ByteArrayInputStream) to an email works perfectly. If i then add another step and zip this file it corrupts the output.
    It looks like it is turning the carriage return into a [] . Its 'almost right' as when I cut & paste the contents of the txt file i created (from the zip file) into Word it displays correctly, with the carriage returns. Is it some kind of encoding problem, or mime type issue?
    My ByteArrayInputStream uses buf.append("\n"); for carriage returns. I think the problem is with
    ByteArrayInputStream baIn = new  ByteArrayInputStream( getAttachementNoFormat(eq_rt.getStoredProc()) );where I think i need to encode this somehow. Here is the complete code to create and add the zip file to an email. Any isuggestions will be appreciated.
    //START of new ZIP code    
                                                                                             /* Specify files to be zipped */
                                                                                            // Create temp file.
                                                                                            //File temp = File.createTempFile(fileName, ".txt");                           
                                                                                            //temp.deleteOnExit();                                                           
                                                                                            //BufferedWriter bOut = new BufferedWriter(new FileWriter(temp));                                                          
                                                                                            //ByteArrayInputStream baInTemp = new ByteArrayInputStream( getAttachementNoFormat(eq_rt.getStoredProc() ) );
                                                                                            //bOut.write( baInTemp.toString() );
                                                                                            //bOut.close();
                                                                                             String[] filesToZip = new String[3];
                                                                                             filesToZip[0] = "C:\\Program Files\\NetBeans3.6\\firstfile.txt";
                                                                                             filesToZip[1] = "C:\\Program Files\\NetBeans3.6\\secondfile.txt";
                                                                                             filesToZip[2] = "C:\\Program Files\\NetBeans3.6\\thirdfile.txt";
                                                                                             final String fileToZip = fileName;
                                                                                             /*  Create a memory buffer to store the ByteArray, fixed size */                                                         
                                                                                             byte[] buffer = new byte[18024];
                                                                                             /* Specify zip file name */
                                                                                             String zipFileName= eq_rt.getReportName() + ".zip";
                                                                                             try {
                                                                                                 /* Create ZipOutputStream to store the FileOutputStream */
                                                                                                 // ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFileName));
                                                                                                 ByteArrayOutputStream byteArray = new ByteArrayOutputStream();                                                             
                                                                                                 ZipOutputStream out = new ZipOutputStream(byteArray);                                                              
                                                                                                 /* Set the compression ratio */
                                                                                                 out.setLevel(Deflater.DEFAULT_COMPRESSION);
                                                                                                 /* iterate through the array of files, adding each to the zip file */
                                                                                                 for (int a = 0; a < filesToZip.length; a++) {
                                                                                                    /* Print the filenumber being added to the zip */
                                                                                                    System.out.println(a);
                                                                                                    /* Associate a file input stream for the current file */
                                                                                                   // FileInputStream in = new FileInputStream(filesToZip[a]);
                                                                                                       This ROCKS as it is passing a array into the text file .getBytes() seems
                                                                                                       to be the KEY in getting ByteArrayInputStream to WORK
                                                                                                    //String strSocketInput = "TAIWAN";
                                                                                                    //ByteArrayInputStream baIn = new ByteArrayInputStream(strSocketInput.getBytes());
                                                                                                    //String strSocketInput = new String (getAttachementNoFormat(eq_rt.getStoredProc()).toString() );                                                                                           
                                                                                                    //ByteArrayInputStream baIn = new ByteArrayInputStream( getAttachementNoFormat(eq_rt.getStoredProc()) );
                                                                                                     ByteArrayInputStream baIn = new  ByteArrayInputStream( getAttachementNoFormat(eq_rt.getStoredProc()) );
                                                                                                    //String strSocketInput = "TAIWAN";
                                                                                                    //ByteArrayInputStream baIn = new ByteArrayInputStream(strSocketInput.getBytes());
                                                                                                    /* Add ZIP entry to output stream. */                                                   
                                                                                                    out.putNextEntry(new ZipEntry(filesToZip[a]));                                                  
                                                                                                    /* Transfer bytes from the current file to the ZIP file */
                                                                                                    int len;
                                                                                                    while ((len = baIn.read(buffer)) > 0)
                                                                                                    out.write(buffer, 0, len);
                                                                                                    /* Close the current entry */
                                                                                                    out.closeEntry();
                                                                                                    /* Close the current file input stream */
                                                                                                    baIn.close();                                                   
                                                                                                /* Close the ZipOutPutStream (very important to close the zip before you attach it to the email) Thanks DrClap */
                                                                                                out.close();                                                    
                                                                                                /* Create a datasource for email attachment */
                                                                                                // DataSource sourcezip = new FileDataSource(zipFileName);
                                                                                                DataSource sourcezip = new ByteArrayDataSource(byteArray.toByteArray(), zipFileName, "application/gzip" );
                                                                                                /* Create a new MIME bodypart */
                                                                                                BodyPart attachment = new MimeBodyPart();
                                                                                                attachment.setDataHandler(new DataHandler(sourcezip));
                                                                                                attachment.setFileName(zipFileName);                       
                                                                                                /* attach the attachemnts to the mail */
                                                                                                multipart.addBodyPart(attachment);                                                       
                                                                                             catch (IllegalArgumentException iae) {
                                                                                               iae.printStackTrace();
                                                                                             catch (FileNotFoundException fnfe) {
                                                                                               fnfe.printStackTrace();
                                                                                             catch (IOException ioe)
                                                                                             ioe.printStackTrace();
                                                                                           // End Of New ZIP code    

    I came up with 'a' solution (not sure if its the best way but appears to work)
    \n = corrupt
    \r\n = ok in zip

  • Information Broadcaster- Fales to send ZIP files reports.

    Hi everybody,
    I schedualed a total of 60 daily sales reports to be sent as ZIP files to varius addresses. the problem is that every day a few of them (1-8) are received but without the ZIP file report and attached to the mail is a txt file with the following message:
    "Symantec Mail Security replaced ZSD_SALES_WS_DR_CAP_TM_VERSION.ZIP with this text message.  The original file was unscannable and was quarantined.
    ID:NODE02::SYQ7d88c154   "
    i don't what is the reason does anybody have a clue?!?!?

    I'm not suggesting there is anything wrong with the files. Symantec is examing the files and based on it's various examinations of the file, is indicating it can not/will not pass them along.  Again - this seems like an issue to pursue with whoever administers your email scanning software.  Don't believe this is a BW issue.
    Perhaps they can configure Symantec not to scan e-mail attachments from the BW server

  • How to insert a ZIP file in the message body and display it as icons

    how to attach an ZIP file as an inline attachment. whether its possible in java mail.

    Stop asking the same thing over and over.
    Keep the discussion in your original thread.

  • Zip file of 8 Mb size is not been recived when using mailx  in solaris 10

    Hi,
    I'm trying to send a zip file of 8 Mb using below cmd
    uuencode .zip .zip|mailx -s " zip " [email protected]
    But i dont recieve the file. but I get mails from that system(just to make sure that mailing works from that system).
    What could be the reason? Is there any other way to send mail with attached of 8mb .zip file?
    Please suggest
    Chaitanya

    >
    This forum is for Sun Messaging Server software only. If you are running Sun Messaging Server on the system in question what is the exact version (./imsimta version). If not I suggest you direct your question to the appropriate forum:
    http://forums.sun.com/forum.jspa?forumID=844
    I'm trying to send a zip file of 8 Mb using below cmd
    uuencode .zip .zip|mailx -s " zip " [email protected]
    But i dont recieve the file. but I get mails from that system(just to make sure that mailing works from that system).
    What could be the reason? Is there any other way to send mail with attached of 8mb .zip file?A uuencoded attachment is ~30% larger then the original file so if your MTA is rejecting emails > 10MB this would explain the behaviour you are seeing. Can you send a smaller attachment?
    Regards,
    Shane.

  • How do I read a zipped file I have received in my mail?

    Hi
    I have received a zipped word file in the mail but cannot open it. Can I fix this?
    J

    You need an app that's capable of reading zipped files to open the attachment in and then unzip it e.g. GoodReader (not sure whether it deals with password protected zip files)

  • Another Attachment Problem

    I used JWSDP 2.0 to generate my client stubs from a WSDL file. I have one web service method that is supposed to allow the client to send a file as a SOAP attachment. Info on defining the WSDL for web service methods that receive attachments from the client seems to be sparse. The one example I found said to set up the WSDL like this:
    <operation name="sendFile">
       <soap:operation soapAction="" />
          <input>
             <mime:multipartRelated>
                <mime:part>
                   <soap:body use="literal" namespace="com.blankety.SomeWSInterface"/>
                </mime:part>
                <mime:part>
                   <mime:content part="fileHandler" type="application/octet-stream" />
                </mime:part>
             </mime:multipartRelated>
          </input>
          <output>
             <soap:body use="literal" namespace="com.blankety.SomeWSInterface"/>
          </output>
    </operation>Actually, the original example didn't have the namespace attribute but wscompile would not create the stub without the namespace defined. So I added that.
    Anyway, the client stub for the above method gets generated fine. But at runtime, the stub throws the following exception:
    javax.xml.rpc.soap.SOAPFaultException: JAXRPCTIE01:
    caught exception while handling request: no attachment with id "fileHandler" found in message
         at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:528)
         at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:307)
         at com.blankety.SomeWSInterfacePortType_Stub.sendFile(SomeWSInterfacePortType_Stub.java:498)
    ...Some research showed that the client has to properly set the Content Id for the attachment. But I looks to me like the code IS properly setting the Content Id, according to the one source I found. Here is the addAttachment method where the id is created. The value of the part argument is "fileHandler", which is what the above Exception is complaining about:
    private void addAttachment(javax.xml.soap.SOAPMessage message, Object value,
             java.lang.String mimeType, java.lang.String part) throws Exception{
          java.lang.String contentId = part + "="
                + com.sun.xml.rpc.util.JAXRPCUtils.getUUID() + "@jaxrpc.sun.com";
          javax.xml.soap.AttachmentPart _attPart = null;
          if (value == null || mimeType == null){
             return;
          if (value instanceof javax.activation.DataHandler){
             _attPart = message
                   .createAttachmentPart((javax.activation.DataHandler) value);
          } else if (value instanceof javax.mail.internet.MimeMultipart){
             java.lang.String contentType =
                ((javax.mail.internet.MimeMultipart) value).getContentType();
             javax.activation.DataHandler dataHandler =
                new javax.activation.DataHandler(value, contentType);
             _attPart = message.createAttachmentPart(dataHandler);
          } else{
             _attPart = message.createAttachmentPart(value, mimeType);
          _attPart.setContentId("<" + contentId + ">");
          message.addAttachmentPart(_attPart);
       }The statement that calls this method is:
    addAttachment(_state.getRequest().getMessage(),
        (Object)fileHandler,
        ((javax.activation.DataHandler)fileHandler).getContentType(),
        "fileHandler");I've run this in the debugger and can see that the attachment is created and that there is a Content Id. Debugger output:
    mimeType     "text/plain" (id=74)     
    part     "fileHandler" (id=81)     
    contentId     "[email protected]" (id=82)     
    _attPart     AttachmentPartImpl  (id=52)     
       dataHandler     DataHandler  (id=56)     
         currentCommandMap     null     
         dataContentHandler     null     
         dataSource FileDataSource  (id=84)     
              _file     File  (id=96)     
              typeMap     null     
         factoryDCH     null     
         objDataSource     null     
         object     null     
         objectMimeType     null     
         oldFactory     null     
         shortType     null     
         transferFlavors     DataFlavor[0]  (id=87)     
         headers     MimeHeaders  (id=60)     
         rawContent     null     Obviously com.sun.xml.rpc.client.StreamingSender is not finding the Content Id. But why? Is it looking in the wrong place? Or is my client stub setting it in the wrong place?
    Edited by: jimgood on Mar 1, 2009 1:13 PM
    Edited by: jimgood on Mar 1, 2009 1:14 PM
    Edited by: jimgood on Mar 1, 2009 1:16 PM

    http://jakarta.apache.org/commons/fileupload/

  • R12 Oracle Diagnostics Zip files

    Sorry if this has been asked before but my understanding is Oracle Support's preference when uploading multiple files to an SR is to zip them into a single zip file.
    However when you are asked by Support to run multiple R12 Oracle Diagnostics each resulting html file arrives compressed in its own zip file.
    This creates a problem because as far as I know you cannot zip multiple zip files together and you must go through the laborious task of extracting out each html file, renaming it so the file name is meaningful, and then zip then all up together into a single zip file.
    Not an issue for 2 or 3 but when you are asked for diagnostics on 20 transactions it can take some time.
    Does anyone know a way around this by perhaps obtaining the resulting html file uncompressed and named with the file name you specified at run time?
    Regards,
    Jim.
    Edited by: Jimbo on 09-Mar-2012 04:16

    Well this is embarrasing. I've just rechecked and you're quite right, it is possible to zip 2 zip files together.
    I could have sworn I've tried this before and it didn't work.
    In any case thank you.

  • Bursting in 10g into a Zip file.

    Hey,
    I wanted to know if its possible to burst a file in a zip file, like the email attachment should be a zip file. I have successfully done busrting with pdf, html and excel outputs for both EMAIL and FTP type. I want to know if Bursting into a zip file is possible. If yes, then please kindly tell me how to configure in the Burst.
    Thanks,
    Suvha Lama

    Hi,
    I have been analysing this. My scripts is to unzip the file and then delete the zip after unzipping.
    The script was working fine in the folder for some time. If we keep on testing the script. It's not deleting the zip after unzipping it.Which is causing PI to process the file multiple times so there are multiple files in backup folder.
    Any suggestion on this?

  • Create Zip File In Windows and Extract Zip File In Linux

    I had created a zip file (together with directory) under Windows as follow (Code are picked from [http://www.exampledepot.com/egs/java.util.zip/CreateZip.html|http://www.exampledepot.com/egs/java.util.zip/CreateZip.html] ) :
    package sandbox;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    * @author yan-cheng.cheok
    public class Main {
         * @param args the command line arguments
        public static void main(String[] args) {
            // These are the files to include in the ZIP file
            String[] filenames = new String[]{"MyDirectory" + File.separator + "MyFile.txt"};
            // Create a buffer for reading the files
            byte[] buf = new byte[1024];
            try {
                // Create the ZIP file
                String outFilename = "outfile.zip";
                ZipOutputStream out = new ZipOutputStream(new FileOutputStream(outFilename));
                // Compress the files
                for (int i=0; i<filenames.length; i++) {
                    FileInputStream in = new FileInputStream(filenames);
    // Add ZIP entry to output stream.
    out.putNextEntry(new ZipEntry(filenames[i]));
    // Transfer bytes from the file to the ZIP file
    int len;
    while ((len = in.read(buf)) > 0) {
    out.write(buf, 0, len);
    // Complete the entry
    out.closeEntry();
    in.close();
    // Complete the ZIP file
    out.close();
    } catch (IOException e) {
    e.printStackTrace();
    The newly created zip file can be extracted without problem under Windows, by using  [http://www.exampledepot.com/egs/java.util.zip/GetZip.html|http://www.exampledepot.com/egs/java.util.zip/GetZip.html]
    However, I realize if I extract the newly created zip file under Linux, using modified version of  [http://www.exampledepot.com/egs/java.util.zip/GetZip.html|http://www.exampledepot.com/egs/java.util.zip/GetZip.html] . The original version doesn't check for directory using zipEntry.isDirectory()).public static boolean extractZipFile(File zipFilePath, boolean overwrite) {
    InputStream inputStream = null;
    ZipInputStream zipInputStream = null;
    boolean status = true;
    try {
    inputStream = new FileInputStream(zipFilePath);
    zipInputStream = new ZipInputStream(inputStream);
    final byte[] data = new byte[1024];
    while (true) {
    ZipEntry zipEntry = null;
    FileOutputStream outputStream = null;
    try {
    zipEntry = zipInputStream.getNextEntry();
    if (zipEntry == null) break;
    final String destination = Utils.getUserDataDirectory() + zipEntry.getName();
    if (overwrite == false) {
    if (Utils.isFileOrDirectoryExist(destination)) continue;
    if (zipEntry.isDirectory())
    Utils.createCompleteDirectoryHierarchyIfDoesNotExist(destination);
    else
    final File file = new File(destination);
    // Ensure directory is there before we write the file.
    Utils.createCompleteDirectoryHierarchyIfDoesNotExist(file.getParentFile());
    int size = zipInputStream.read(data);
    if (size > 0) {
    outputStream = new FileOutputStream(destination);
    do {
    outputStream.write(data, 0, size);
    size = zipInputStream.read(data);
    } while(size >= 0);
    catch (IOException exp) {
    log.error(null, exp);
    status = false;
    break;
    finally {
    if (outputStream != null) {
    try {
    outputStream.close();
    catch (IOException exp) {
    log.error(null, exp);
    break;
    if (zipInputStream != null) {
    try {
    zipInputStream.closeEntry();
    catch (IOException exp) {
    log.error(null, exp);
    break;
    } // while(true)
    catch (IOException exp) {
    log.error(null, exp);
    status = false;
    finally {
    if (zipInputStream != null) {
    try {
    zipInputStream.close();
    } catch (IOException ex) {
    log.error(null, ex);
    if (inputStream != null) {
    try {
    inputStream.close();
    } catch (IOException ex) {
    log.error(null, ex);
    return status;
    *"MyDirectory\MyFile.txt" instead of MyFile.txt being placed under folder MyDirectory.*
    I try to solve the problem by changing the zip file creation code to
    +String[] filenames = new String[]{"MyDirectory" + "/" + "MyFile.txt"};+
    But, is this an eligible solution, by hard-coded the seperator? Will it work under Mac OS? (I do not have a Mac to try out)
    p/s To be honest, I do a cross post at  [http://stackoverflow.com/questions/2549766/create-zip-file-in-windows-and-extract-zip-file-in-linux|http://stackoverflow.com/questions/2549766/create-zip-file-in-windows-and-extract-zip-file-in-linux] Just want to get more opinion on this.
    Edited by: yccheok on Apr 26, 2010 11:41 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Your solution lies in the File.separator constant; this constant will contain the path separator that is used by the operating system. No need to hardcode one, Java already has it.
    edit: when it comes to paths by the way, I have the bad habit of always using the front slash ( / ). This will also work under Windows and has the added benefit of not needing to be escaped.

  • Scenario: SOAP message with attached .zip file to FTP ?

    Hi all,
    I've searched SDN etc but got no good hints to my problem.
    My scenario is tht we are receiving an XML message via SOAP adapter and this is a MIME multipart message so it carries also a attached zip-file.
    The XML and the attached zip-file should then be saved over FTP.
    It enters IS correctly and I can see that I have the attachment and it goes to AE. I can see payload and attachment in the statusreport on receiver cc.
    The FTP adapter saves the payload XML correctly but the attachment is not saved anywhere.
    I have not configured any modules, BIC etc in the FTP adapter and I need some input on how to set this up tp put both files on FTP server.
    In the future the FILE adapter will be used and then I wounder if I will get the same problem there?

    I dont think there is a direct way of doing this. I can suggest you a method. In the directory receiver determination use 2 receivers with no condition. You message will get split in to two now. Create the interface determinations and receiver agreements. Complete one of them normally. It will sav the xml t FTP. For the other one, in the adapter use the payloadswapbean. It will swap the attachement to payload. THis one would save your zip on the ftp server.
    Hope its clear..!!
    VJ

Maybe you are looking for