<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Issue while sending a zipped file from ABAP to JAVA layer in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-sending-a-zipped-file-from-abap-to-java-layer/m-p/6958935#M1489658</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I could read in [wikipedia - gzip|http://en.wikipedia.org/wiki/Gzip]:&lt;/P&gt;&lt;P&gt;&amp;gt; gzip is not to be confused with the ZIP archive format, which also uses DEFLATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, could you try the CL_ABAP_GZIP class instead of ZIP. See this code sample: [ABAP Class to gzip and gunzip|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c6b79908-0a01-0010-8ca0-b77aff37726d]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Jun 2010 09:25:58 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2010-06-07T09:25:58Z</dc:date>
    <item>
      <title>Issue while sending a zipped file from ABAP to JAVA layer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-sending-a-zipped-file-from-abap-to-java-layer/m-p/6958930#M1489653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement wherein i have to zip a xml file in abap, convert it to base64 encoded string and send it to JAVA layer.&lt;/P&gt;&lt;P&gt;I'm using the class CL_ABAP_ZIP for zipping the xml string and FM "SCMS_BASE64_ENCODE_STR" to convert the zipped data to base64 encoded string.&lt;/P&gt;&lt;P&gt;But on the JAVA layer we get an exception while unzipping this data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anybody come across a similar situtation.&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ankit Agrawal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jun 2010 11:48:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-sending-a-zipped-file-from-abap-to-java-layer/m-p/6958930#M1489653</guid>
      <dc:creator>ankit_agrawal</dc:creator>
      <dc:date>2010-06-03T11:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Issue while sending a zipped file from ABAP to JAVA layer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-sending-a-zipped-file-from-abap-to-java-layer/m-p/6958931#M1489654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Example&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  Z_PAP_UP_ZIP_DL.
DATA: L_ZIPPER TYPE REF TO cl_abap_zip.
DATA: FILEX type XSTRING.
DATA: FILENAME type string.
DATA: PATH type string.
DATA: zip type xstring.
DATA: FILE_N_TAB type FILETABLE.
DATA: FULL_PATH type string.
DATA: FILE_LENGTH type i.
DATA: FILE_TAB type w3mimetabtype.
DATA: WA_INT type int4.
DATA: PATH_TABLE TYPE TABLE of char1024.
"-----------------------------------------------------------------------------
"    Load the file
"-----------------------------------------------------------------------------
"Which file to upload
CALL METHOD CL_GUI_FRONTEND_SERVICES=&amp;gt;FILE_OPEN_DIALOG
  CHANGING
    FILE_TABLE              = FILE_N_TAB
    RC                      = WA_INT
        .
"load the (first) file from the frontend the user has selected.
LOOP at FILE_N_TAB into FULL_PATH.
 "get the file
  CALL METHOD CL_GUI_FRONTEND_SERVICES=&amp;gt;GUI_UPLOAD
     EXPORTING
       FILENAME                = FULL_PATH
       FILETYPE                = 'BIN'
    IMPORTING
      FILELENGTH              = FILE_LENGTH
    CHANGING
      DATA_TAB                = file_tab.
    exit.
endloop.
"create xstring from table
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
  EXPORTING
    INPUT_LENGTH       = FILE_LENGTH
  IMPORTING
    BUFFER             = FILEX
  TABLES
    BINARY_TAB         = file_tab
"get the name of the file. we take entry after the last '\' ...windows.
SPLIT FULL_PATH AT '\' INTO TABLE PATH_TABLE.
DESCRIBE TABLE PATH_TABLE LINES WA_INT.
READ TABLE PATH_TABLE INTO FILENAME INDEX WA_INT.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jun 2010 12:57:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-sending-a-zipped-file-from-abap-to-java-layer/m-p/6958931#M1489654</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-03T12:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Issue while sending a zipped file from ABAP to JAVA layer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-sending-a-zipped-file-from-abap-to-java-layer/m-p/6958932#M1489655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Continue.........&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
"-------------------------------------------------------------------------------
"   ZIP the file
"-------------------------------------------------------------------------------
"create our zipper object
CREATE OBJECT L_ZIPPER.
"add file to zip
CALL METHOD L_ZIPPER-&amp;gt;ADD
  EXPORTING
    NAME    = filename
    CONTENT = filex
   .
"save zip
 CALL METHOD L_ZIPPER-&amp;gt;SAVE
   RECEIVING
     ZIP    = zip
     .

"-------------------------------------------------------------------------------
"    Save the file
"-------------------------------------------------------------------------------
"convert to table
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
  EXPORTING
    BUFFER                = zip
  IMPORTING
    OUTPUT_LENGTH         = file_length
  TABLES
    BINARY_TAB            = file_tab
          .
"File save dialog
CALL METHOD CL_GUI_FRONTEND_SERVICES=&amp;gt;FILE_SAVE_DIALOG

  CHANGING
    FILENAME             = filename
    PATH                 = path
    FULLPATH             = full_path
        .
"Save the file
  CALL METHOD CL_GUI_FRONTEND_SERVICES=&amp;gt;GUI_DOWNLOAD
    EXPORTING
      BIN_FILESIZE              = file_length
      FILENAME                  = full_path
      FILETYPE                  = 'BIN'
    CHANGING
      DATA_TAB                  = file_tab
      .
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jun 2010 12:58:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-sending-a-zipped-file-from-abap-to-java-layer/m-p/6958932#M1489655</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-03T12:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Issue while sending a zipped file from ABAP to JAVA layer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-sending-a-zipped-file-from-abap-to-java-layer/m-p/6958933#M1489656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ankit, you should at least tell us if you can read the ZIP file on your personal computer? and what exact error messages you get at JAVA side?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jun 2010 20:52:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-sending-a-zipped-file-from-abap-to-java-layer/m-p/6958933#M1489656</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2010-06-03T20:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Issue while sending a zipped file from ABAP to JAVA layer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-sending-a-zipped-file-from-abap-to-java-layer/m-p/6958934#M1489657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the Java side we get "Not in GZIP format" error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code that is used on JAVA side for decoding and unzipping is as under:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;		byte[] decoded = Base64.decode(inputXML);&lt;/P&gt;&lt;P&gt;		GZIPInputStream stream = new GZIPInputStream(new ByteArrayInputStream(decoded));&lt;/P&gt;&lt;P&gt;		InputSource inSrc = new InputSource(stream);&lt;/P&gt;&lt;P&gt;		return inSrc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ankit Agrawal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jun 2010 08:00:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-sending-a-zipped-file-from-abap-to-java-layer/m-p/6958934#M1489657</guid>
      <dc:creator>ankit_agrawal</dc:creator>
      <dc:date>2010-06-07T08:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Issue while sending a zipped file from ABAP to JAVA layer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-sending-a-zipped-file-from-abap-to-java-layer/m-p/6958935#M1489658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I could read in [wikipedia - gzip|http://en.wikipedia.org/wiki/Gzip]:&lt;/P&gt;&lt;P&gt;&amp;gt; gzip is not to be confused with the ZIP archive format, which also uses DEFLATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, could you try the CL_ABAP_GZIP class instead of ZIP. See this code sample: [ABAP Class to gzip and gunzip|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c6b79908-0a01-0010-8ca0-b77aff37726d]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jun 2010 09:25:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-sending-a-zipped-file-from-abap-to-java-layer/m-p/6958935#M1489658</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2010-06-07T09:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Issue while sending a zipped file from ABAP to JAVA layer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-sending-a-zipped-file-from-abap-to-java-layer/m-p/6958936#M1489659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An alternative so the solution proposed by Sandra would be to adjust your coding on the Java side to handle the zip files. You could utilize for example the [java.util.zip.ZipInputStream|http://java.sun.com/j2se/1.5.0/docs/api/java/util/zip/ZipInputStream.html] class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main difference between gzip and zip from a functional perspective is that the first one compresses only single files, whereas the zip format can compress multiple files into one archive (thus gzip is often combined with tar, which creates an uncompressed archive of multiple files). With the zip format you'd deal with [java.util.zip.ZipEntry|http://java.sun.com/j2se/1.5.0/docs/api/java/util/zip/ZipEntry.html] classes to get to the content of each file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if you anticipate that you possibly might have at some point a requirement to handle more than one file, I'd stick with the zip format and adjust the Java coding. As always, there's lots of examples on the internet, see for example the article [compressing and decompressing data using Java API's|http://java.sun.com/developer/technicalArticles/Programming/compression/].&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jun 2010 19:34:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-while-sending-a-zipped-file-from-abap-to-java-layer/m-p/6958936#M1489659</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-07T19:34:37Z</dc:date>
    </item>
  </channel>
</rss>

