IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  writetofile throwing null error

    Posted Thu March 19, 2009 04:36 PM

    Hi,

    I am trying to write a file using - ‘PSUtilities.file:writeToFile’ at some directory which has been specified in allowed write paths in PSUtilities config file. When I execute that service with filename , data and appendOverwriteFlag = failIfFileExists , it writes blank file at specified directory and throws error null if file does not exits where as throws correct error of ‘File already exists’ in other case.

    Can someone help me with this , why its writing a 0kb file?

    Thanks in advance.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 2.  RE: writetofile throwing null error

    Posted Thu March 19, 2009 05:35 PM

    appendOverwrite flag should be set to either “append” or “Overwrite”


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 3.  RE: writetofile throwing null error

    Posted Thu March 19, 2009 06:05 PM

    The allowable values for appendOverwriteFlag are (case-sensitive)

    append
    overwrite
    failIfFileExists

    In reviewing the code, the obvious case where a NPE will be thrown is if userData is null. Verify that the userData variable you are passing to this service is not null.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods