FTPS: Writing empty files

Hi Gurus,
I have PROXY -> XI -> File scenario and we have to use FTPS to secure the connection.
I have done the following steps -
1. Imported the public key certificate from 3rd party FTP server into the Trusted CA section of the Keystore in visual Admin. The CN name in the certificate is same as the server name maintained in communication channel.
2. In File receiver Comm channel -
      a. I have selected the connection security as FTPS for control and data connection.
      b. command order is default command order.
      c.. Use X.509 certificate is unticked and no certificate is selected.
      d. A valid user name and password entered in comm channel. (the password is correctly entered)
      e. Target directory maintained as /xxx/xxx (which is the default directory of the user)
3. The third party server can do FTPS as I am successfully able to connect and transfer files to the directory on that server using File-Zilla tool. When I try and connect using FTPS using File-Zilla, it prompts me for the certificate and once I accept the certificate, I can see the files in the folder. I used the same user id and password in FileZilla that I have used in comm. Channel.
When I run the scenario (we have PI7.0), its writing empty files in the folder on the target server. When checked in RWB its throwing error - Error occurred while connecting to the FTP server "xxxx.xxxx.com:21": iaik.security.ssl.SSLCertificateException: Peer certificate rejected by ChainVerifier.
If I change the target directory from the /xxx/xxx to '/' (without quotes) then no file is written and I get error - An error occurred while connecting to the FTP server 'xxx.xxx.com:21'. The FTP server returned the following error message: 'com.sap.aii.adapter.file.ftp.FTPEx: 553 Could not create file.'. For details, contact your FTP server vendor.
The permissions for the folder are 777 and the file name is as simple as abc.xml.
My contact on the target server is not able to help either as I am able to connect to his server using FTPS.
Not sure whats going wrong. Any help will be appreciated.
Thanks,
Rahul.

Hi Rahul,
Try selecting the keystore and X.509 certificate that you loaded in VA, in the communication channel.
I think you need to specify this certificate in communication channel for verification.
Also please check Q24 of Note 821267 - FAQ: XI 3.0 / PI 7.0/ PI 7.1 File Adapter (I think you loaded the certificate to trustedCA as described in this note)
if didnt work check your command order AUTH TSL,USER,PASS,PBSZ,PROT
have look into this thread as well Re: FTP/SSL Connection Problem for FTP Receiver Adapter
regards,
francis

Similar Messages

  • FTP problem: empty file being picked up

    Use case:
    - I am writing a file with the FTP adapter to a remove FTP server
    - Another application polls the folder where I put my file
    - The application picks up the file and processes it
    Problem
    - The moment that the FTP adapter starts writing, the other application recognizes the (empty) file and picks it up
    - The application processes only the empty file
    Questions
    - Is there a way to block the other application from picking up the file?
    - What is a best practice for this situation?
    - Is there a way to implement some type of handshake?
    - Will I also have this problem when another application writes a file to a folder where a BPEL file/ftp adapter is polling?
    Thanks,
    Jan Willem

    Another common practice is to give the file an extra extension while ftp upload is in progress:
    upload.xml.tmp
    Then after the upload finishes it should be renamed.
    And another (!) practice is to upload two files:
    upload.xml
    upload.upl
    upload.upl only contains the filename of upload.xml, have upload.upl only uploaded when upload.xml is finished. let your adapter poll for upl files instead of xml files, and read out the contents of the upl file.

  • Writing files with Eclipse over gvfs ends in empty files

    Hello,
    I'm using gvfs to mount folders from our development server. I'm accessing these folders directly with Eclipse. Everything went fine until the last gnome update. Now writing files with Eclipse ends in writing empty files, but there aren't any errors. Eclipse still shows the content of the files until i reopen them.
    When i'm writing files with other apps (vim, gedit) everything works normally?
    Does anybody have any suggestions?
    Thx

    Hello,
    I'm using gvfs to mount folders from our development server. I'm accessing these folders directly with Eclipse. Everything went fine until the last gnome update. Now writing files with Eclipse ends in writing empty files, but there aren't any errors. Eclipse still shows the content of the files until i reopen them.
    When i'm writing files with other apps (vim, gedit) everything works normally?
    Does anybody have any suggestions?
    Thx

  • Empty file created in Receiver FTP content conversion

    Hi,
    The receiver FTP channel is generating an empty file.
    The entry for the message in sxi_monitor is successful, also the target payload is having values.
    Still the file content conversion is generating an empty file.
    The three parameters given in content conversion are:
    1. fieldFixedLengths
    2. fieldNames
    3. end Separator
    Kindly help.
    Thanks,
    John

    Hi John
    I hope your structure is like this :
    Root Node
    ...Child Node
    .......field1
    .......field2  & so on...
    If so, in recordset structure add the name of the Root Node too. I faced the same issue sometime back.
    Use the same parameters for Root Node that you are using for Child Node.
    Apart from this check the payload in Message Display tab(communication channel monitoring) in RWB.
    Regards
    Soumen....

  • Empty files are getting created at receiver FTP server

    Hi Experts,
    I have an Idoc to File scenario where I am sending an XML file to receiver FTP server.
    Scenario is working fine but sometimes an empty file is getting generated at receiver FTP server.
    I have already selected ignore empty file at receiver channel so issue is not within PI system configuration.
    When I checked the message log I can see that almost all the files are getting created successfully without any issues, but
    for some files/messages I can see that there are below error logs.
    "Transmitting the message to endpoint <local> using connection IDoc_AAE_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Could not get FTP connection from connection pool (1 connections) within 5,000 milliseconds; increase the number of available connections"
    "Exception caught by adapter framework: Could not get FTP connection from connection pool (1 connections) within 5,000 milliseconds; increase the number of available connections."
    And after there is again success message log in the same message and it creating a file successfully during that time stamp.
    but the third party is sometime receiving empty file which I am not able to find in any trace or log (my file name is SD_timestamp.xml).
    Can you please let me know what is the solution and what adjustments FTP server need to do in order to resolve this issue.
    Thanks in advance.
    Regards,
    Rahul Kulkarni

    The error you are getting that says "Could not get FTP connection from connection pool (1 connections) within 5,000 milliseconds; increase the number of available connections" has probably nothing to do with the empty files problem.
    I second Hareesh Gampa that you first should try "temporary file creation". You might also need to tell the FTP owner that he should only pick up files with that are written completely and that do comply with a negotiated file name schema. The temp file should have another schema of course then. He should not pick up just every file that is written. See here for details
    http://help.sap.de/saphelp_nw74/helpdata/en/44/6830e67f2a6d12e10000000a1553f6/content.htm
    HTH
    Cheers
    Jens

  • Empty file is getting generated at Target FTP Folder side

    HI all,
    I have scenario like Idoc to File In Target FTP folder is empty file is generated, In adapter engine (communication channel) it shows the successfull status and pay load is getting created at Message display tool in the Message ID tab.But FTP server will receive only Empty file.
    Please Give me some advise to resolve this issue..
    Regards,
    satya Tanuku

    Hi Satya,
      If you are using FCC then troubleshoot using this blog...
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    Regds,
    Pinangshuk.

  • Receiver-File-Adatper creates empty files on FTP-Server

    Hi experts,
    I have a problem with my IDOC-to-File-scenario. My Mapping converts IDOCs to XML-files. Then the xml-files should be send to a ftp-server in New York. but only the filename is created on the ftp-server in New York. but without any content.
    At first I tested the scenario with a ftp-server in our company. and it works. the files and the right content were created. so the scenario and the mapping are working correctly.
    Have you any idea what the problem is?
    Thanks and best regrads
    Christopher

    Dont use anonymous login. Please provide user name and password.
    Also go to adapter engine queue. There see the details description of your message. There it will specify which file got created, on which FTP server, in which folder and also how many bytes XI has transferred. If possible let me know these details.
    Also try uploading any other file to FTP.
    For this got to Command prompt.
    1. open (o) IP ADDRESS
    2. User name
    3. Password
    4. go to specified folder
    5. Use PUT command to save the file on FTP server.
    If after all these empty files is getting created then contact your system administrator and tell him to check firewall settings. Because there are few parameters which allows data transfer.
    Because if firewall problem is there then u wont be able to put a file manually on that FTP server.
    Let me know the output.
    Warm Regards,
    Gouri

  • FtpAdapter doesn't transfer empty files

    Hi there,
    I am trying put an empty file (= 0 bytes) to another server via the FtpAdapter, using a SFTP-Connection.
    The log doesn't display any error but only the successful transmission, but on the
    destination server there is no file written. I've tried to switch from ascii to binary without success. Here's the log:
    <File Adapter::Outbound> Successful in setting up the SFTP connection
    <File Adapter::Outbound> Managed Connection Created
    <File Adapter::Outbound> Adding Event Listener
    <File Adapter::Outbound> Creating Connection
    <File Adapter::Outbound> Connection Created
    <File Adapter::Outbound> Connection manager allocated connection :oracle.tip.adapter.ftp.FTPConnection@ae401b
    <File Adapter::Outbound> Creating FTPInteraction
    <File Adapter::Outbound> Creating an SFTPSender
    <File Adapter::Outbound> SFTP Sender created
    <File Adapter::Outbound> FTPInteraction Created
    <AdapterFramework::Outbound> Instantiating outbound JCA interactionSpec oracle.tip.adapter.ftp.outbound.FTPInteractionSpec
    <AdapterFramework::Outbound> Populating outbound JCA interactionSpec oracle.tip.adapter.ftp.outbound.FTPInteractionSpec with properties: {FileNamingConvention=dummy, OpaqueSchema=true, NumberMessages=1, PhysicalDirectory=/, FileType=binary}
    <AdapterFramework::Outbound> file:/u01/app/oracle10g/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_CpOutput_1.0_0053ad28af82f0120114b2f22390139c.tmp/FtpSendDiva.wsdl [ Put_ptt::Put(opaque) ] - Starting JCA LocalTransaction
    <AdapterFramework::Outbound> file:/u01/app/oracle10g/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_CpOutput_1.0_0053ad28af82f0120114b2f22390139c.tmp/FtpSendDiva.wsdl [ Put_ptt::Put(opaque) ] - Invoking JCA outbound Interaction
    <File Adapter::Outbound> FTP outbound adapter interaction invoked : oracle.tip.adapter.ftp.outbound.FTPInteractionSpec@18bdbcf
    <File Adapter::Outbound> FTP outbound adapter write file interaction invoked.
    <File Adapter::Outbound> File Adapter received an input Record
    <File Adapter::Outbound> Waiting outside sync object.....
    <File Adapter::Outbound> Considering header for filename, output filename from header: testfile.csv
    <File Adapter::Outbound> Not Considering header for directory as it is blank
    <File Adapter::Outbound> Inside getUniqueDirectory::InteractionSpec getProcessName for [bpel://localhost/default/CpOutput~1.0/] returned [CpOutput~1.0]
    <File Adapter::Outbound> GenUtil::getUniqueDirectory::InteractioSpec [localhost_default_CpOutput~1.0_/FtpSendD//] ==> [CpOutput~1.0/CKlx14IRspFHDdTf6wtdDA==]
    <File Adapter::Outbound> MD5 BaseDir is [cut]
    <File Adapter::Outbound> Batcher created using staging : true with number of messages : 1
    <File Adapter::Outbound> ServerType: unix
    <File Adapter::Outbound> Specified ServerType: unix, using unix LineSeparator
    <File Adapter::Outbound> Input Record: javax.xml.transform.dom.DOMSource@10c1cdc
    <File Adapter::Outbound> Translating....
    <File Adapter::Outbound> Outbound Translation done.
    <File Adapter::Outbound> Refreshed (staging/num Messages) file count : 1
    <File Adapter::Outbound> Wrote to Control File
    <File Adapter::Outbound> Batching staging File: staging0
    <File Adapter::Outbound> Batcher sending to sender for output file writing
    <File Adapter::Outbound> Sending File to output Dir
    <File Adapter::Outbound> Obtaining SFTP Agent
    <File Adapter::Outbound> Putting file: testfile.csv to: / Append: false
    <File Adapter::Outbound> Put file:
    <File Adapter::Outbound> Done Writing to output file testfile.csv in dir / !!
    <File Adapter::Outbound> End clearing Control File
    <File Adapter::Outbound> Deleting staging File: staging0
    <File Adapter::Outbound> End clearing Control File
    <File Adapter::Outbound> Interaction gets a ok response
    <File Adapter::Outbound> Done with Input Record
    <AdapterFramework::Outbound> file:/u01/app/oracle10g/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_CpOutput_1.0_0053ad28af82f0120114b2f22390139c.tmp/FtpSendDiva.wsdl [ Put_ptt::Put(opaque) ] - Committing JCA LocalTransaction
    It works when the file is not empty.
    It also works, when i transfer the file manually via 'sftp', so the problem is not the sftp-Server.
    Any hints how I can transfer empty files?
    We're using 10.1.3.1.
    TIA, Roman

    Do you have the right boxes checked to sync them to your iPod:
    iTunes 11 for Windows: Set up syncing for iPod, iPhone, or iPad
    iTunes 11 for Mac: Set up syncing for iPod, iPhone, or iPad
    Did you look in the More section of the Music app?
    Have you tried using the Spotlight search> Maybe you just can't find them

  • Multithreading - writing to file

    How can I get to write the Thread name, date and time to a file with the same thread name?
    What would I need to do to write the same information 1000 times to the file? Thank you.
    import java.lang.Thread;
    import java.lang.InterruptedException;
    public class RiveraThreadsMain {
        public static void main(String[] args) {
          System.out.println("Creating threads");
          Thread riverathread0 = new Thread (new RiveraThreads ("riverathread0"));
          Thread riverathread1 = new Thread (new RiveraThreads ("riverathread1"));
          Thread riverathread2 = new Thread (new RiveraThreads ("riverathread2"));
          System.out.println("Threads created, starting tasks.");
          riverathread0.start(); // invokes thread1's run method
          riverathread1.start(); // invokes thread2's run method
          riverathread2.start(); // invokes thread3's run method
          try
           Thread.currentThread() .sleep (10000);
          catch (InterruptedException e)
            e.getStackTrace();
             System.out.printf (
             "terminated prematurely due to interruption");
          System.out.println("Tasks started, main thread ends. \n");   
        } // end main
    import java.io.File;
    import java.io.IOException;
    import java.util.NoSuchElementException;
    import java.io.FileNotFoundException;
    import java.util.Formatter;
    import java.util.NoSuchElementException;
    import java.util.Calendar;
    import java.util.Scanner;
    public class RiveraThreads implements Runnable {
    Thread launcher;
    private String taskName;
    private Scanner input;
    private Formatter output;
    // empty constructor
    public RiveraThreads (){
      public RiveraThreads (String threadName)
        launcher = new Thread ( this, threadName );
        System.out.println ( launcher.getName());
        launcher.start();
       // taskName = name; // set task name
      public void run ()
        //System.out.println(Thread.currentThread().getName());
        try
          Calendar dateTime = Calendar.getInstance();
        //  output = new Formatter (new File (launcher.getName() ));
          input = new Scanner( new File( launcher.getName() ) ); 
          output = new Formatter (new File ( launcher.getName() ));
          System.out.printf( launcher.getName() + "%tc\n", dateTime );
        }// end try
        catch ( NoSuchElementException exception)
            exception.getStackTrace();
            System.out.printf ( "%s %s \n ", taskName,
             "terminated prematurely due to interruption");
        }// end catch
        catch ( FileNotFoundException filenotfound )
            System.out.printf (" %s %s \n ", filenotfound,
              "File not found");
        catch (IOException ioexception)
          System.err.printf(
            "Unable to read file");
        // close file and terminate application
       public void closeFile()
             input.close();
          }// close file
              output.close();
       } // end method closeFile
    }

    FRiveraJr wrote:
    Hi jverd
    What are you having trouble with?
    I know how to use the BufferedReader and BufferedWriter for opening, reading and writing to file. But the trouble consists in a lot of code to write and how will I call the appropriate file name since it is supposed to be
    the same name as the thread into all of this? I still don't know what problem you're having.
    You know how to provide a file name, right?
    Do you know how to get a thread name?
    If both are "yes", then I don't see what's left that you'd be having problems with. You need to be specific. Nobody here can read your mind, since it's the holidays.
    Writing to a file?
    Yes, I'm getting the correct results to the console with the thread name and the calendar option with the date and time and this is the data that needs to be written to a file. Isn't there a more simple way?A simpler way than your current code? How can anybody answer that without seeing your code?
    What would I need to do to write the same information 1000 times to the file?
    Because that is part of the requirements. Is not that I am insane :0).... This is just part of developing my skills since I'm new to all this. So, do you still have a question about this part? You do know how to loop, right? If not, you shouldn't be getting anywhere near I/O or multithreading.

  • Empty file handling in Receiver File adapter (FCC - Premature end of file)

    Hi
    My interface is Flat file to Flat File interface with file content conversion which is working fine in SAP PI 7.1 EHP1.
    If I want to process the empty file from sender system, PI should place the same empty file in the receiver FTP Location as per my requirement.
    I am facing the below error message when PI tries to place the empty file.
    Message processing failed. Cause: org.xml.sax.SAXParseException: Premature end of file.
    But if I am not using FCC, I am able to get the empty file at the receiver end.
    Please suggest on this, If I am using FCC in the receiver side.
    Thanks
    Gabriel

    Hi Gabriel,
                       You can write a simple script to copy a file from source folder to target in case the fiel size is ZERO bytes. The script will not copy the file if the filesize is more than zero bytes, This will be processed normally by PI server. You can call the script from sender communication channel parameter : "RUN OS command before message processing". Could you please specify the Operating System (OS) you are using in your PI server.
    Regards
    Anupam

  • Empty file receiver - file adapter

    Hello,
    Scenario: File->XI->File.
    In my scenerio, I am using Java mapping to name the target filename and creating text file that is later sent to FTP, in that way I don't have to use content conversation, to save performance...
    I am on PI7.1 version so I have checked the options (Processing Parameters) for empty file handling in Sender/Receiver file communication channels.
    Issue:- Though the target file is created but it always contain 1 byte(NULL character). Any ideas??
    Thanks
    Anshul

    > In my scenerio, I am using Java mapping to name the target filename and creating text file that is later sent to FTP, in that way I don't have to use content conversation, to save performance...
    >
    The java mapping is genarating output as text file,right??have you tested your java mapping in NWDS or eclipse,because when you test in Operation mapping you will get error for text file,because it is not well formed.
    if your java mapping genarating text files perfectly then file content conversion not required at all,just give file name in Communication channel.
    > I am on PI7.1 version so I have checked the options (Processing Parameters) for empty file handling in Sender/Receiver file communication channels.
    >
    Why you have selected  empty file handling??it is not required.
    > Issue:- Though the target file is created but it always contain 1 byte(NULL character). Any ideas??
    >
    >
    unselct empty file handling test your interface with real data.
    let me know your issue.
    Regards,
    Raj

  • Empty file after replace

    Hello
    I am facing a very strange problem saving files. Find attached a quick example showing the issue.
    The first time I hit "save" and choose a name for the file (numbers.txt, for example), everything works great and the file is created with my data. Nevertheless, if I save the file numbers.txt the first time and then I click on "save" again and choose the same name for the file and click YES after "The file already exists. Do you want to replace it?", the file numbers.txt is replaced, but it gets empty!!!! If I click on "save" again and choose another name (results.txt, for example), the file results.txt is created properly. If I try to replace the file results.txt I will get the same error with an empty file again.
    I think that the issue has something to do with "trying to write SAME DATA TWICE in a file", even choosing to "replace" the file. If you stop running the VI, start again, and try to save replacing a file that already exists, the file will not get empty.
    Thanks.
    Dan07
    Solved!
    Go to Solution.
    Attachments:
    Save File - Problem.vi ‏11 KB

    Dear Dan07,
    After you are done writing to the file, you should finish the whole operation with closing the file. Also, your original code writes the same set of random nubers to the file all the time. If you place the random nuber generation code inside your while loop, it will run every time you press the save button and it will generate a new set of random numbers. Please see the attached snippet for an example.
    If you have any further questions, please feel free to ask!
    Daniel
    Attachments:
    Save File with Close.png ‏25 KB

  • Empty file, java mapping issue

    Hello,
    does anyone have an ide how to create java mapping to create empty file on FTP?
    Why this code always send NUL character = 1byte and not 0 byte as needed?
    public void execute(InputStream in, OutputStream out) throws StreamTransformationException {
    out = null;

    try 1 thing...
    run ur code for some standalone file.
    create a file at ur local harddisk and check out its size..
    i had tried creating such a file using the code below....
    it is creating a 0 byte file successfully.
    public class TestCode {
         public static void main(String ags[]){
         try{
         TransformerFactory tf = TransformerFactory.newInstance();
         Transformer transform = tf.newTransformer();
         FileOutputStream out;
         out = new FileOutputStream("c:
    OutTestCode.xml");
         transform.transform(null, new StreamResult(out));
         } catch (FileNotFoundException e1) {
              e1.printStackTrace();
         } catch (TransformerConfigurationException e) {
              e.printStackTrace();
         } catch (TransformerException e) {
              e.printStackTrace();

  • Create .txt empty file After Message Processing Command Line Linux command

    Hi All,
    An empty .txt file has to be created in FTP location(FTP loc c:\xyz\Customer20082910.txt) only after the .dat file has been created(FTP loc c:\xyz\Customer20082910.dat)
    Note:.dat has the actual data and .txt is an empty file and is created only after .dat is created
    I know that .txt empty file can be created using the After Message Processing Command Line...
    But confused which command to be given such that it will be created in the FTP location(c:\xyz\Customer20082910.txt)
    Can any one please give the Linux command for it...
    Regards,
    Sridhar

    Hi Aamir,
    Thanks for the suggestion, I will ask my client to create a shell script at FTP server...
    And one more question,
    This is reverse side , now the .dat file is to be picked only if .txt exists at the FTP server (scenario File > XI>SAP) (earlier was SAP>XI>File)..
    So please can you suggest for this also...
    How can i check for the .txt and pick corresponding .dat file...
    i had posted question long back
    Need to pick .TXT file only if .CTL file is available
    Regards,
    Sridhar

  • Sending empty files using SFTP Adapter

    I am trying to send empty files using SFTP adapter. The interface has to send the file whether its empty file or containing data using SFTP adapter. I am using BizTalk Server 2013 R2. Is it a bug or the hotfix is already there for this issue.

    The issue here is not your SFTP not able to send 0KB files, but the file receive adapter that is receiving the file. The file adapter deletes 0 KB files and doest not transmit it further.
    If u have a ftp receive for example you should be able to send 0KB files.
    If u have a custom file receive adapter , is it handling 0KB files ?
    Regards &lt;br/&gt; When you see answers and helpful posts,&lt;br/&gt; please click Vote As Helpful, Propose As Answer, and/or Mark As Answer

Maybe you are looking for