I agree with Cort that checking the filesize is probably masking another problem. You really should investigate why the get of the file is failing. My suspicion is that the file is locked by the process that is writing the file–thus you can see it via ls but you can’t get it.
If this is the case, you might consider changing the interaction. The process that is writing the file should use a particular name pattern, such as *.tmp when writing. When the write is done, it renames the file to another pattern, such as *.dat. (Renames are atomic operations which either completely succeed or fail and no locks can exist on the file.) Your process then does ls and get for *.dat and will never try to retrieve a partial or locked file.
#Integration-Server-and-ESB#webmethods-Protocol-and-Transport#webMethods