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.  Listing files in directory

    Posted Mon July 23, 2012 07:53 AM

    Hi,

    Can some one help us with the below scenario.

    I have few text files with some content in the directory and now have to read content of all these files in that directory and need to write it to single file.

    Thanks,
    Arjun


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


  • 2.  RE: Listing files in directory

    Posted Mon July 23, 2012 07:35 PM

    Hi Arjun,

    To read the contents of file, getFile in-bulit service can be used.

    -Ambrish-


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


  • 3.  RE: Listing files in directory

    Posted Tue July 24, 2012 04:57 AM

    And to write, you can use pub.file:streamToFile or pub.file:stringToFile with append set to ‘true’.

    -Senthil


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


  • 4.  RE: Listing files in directory

    Posted Tue July 24, 2012 08:35 AM

    Hi Senthil,

    Thanks for your quick response.
    Here first thing is how to list all the files in a directoy,before read.If we have list then we keep those list in loop and we can read and write each file.

    one more thing am unable to see these pub.file:streamToFile or pub.file:stringToFile two services .do we need to install any plug-in or they will be included in IS installation.

    I am using IS 7.1


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


  • 5.  RE: Listing files in directory

    Posted Tue July 24, 2012 04:32 PM

    PSUTILITIES package contains listFIles service to list files in a service…or else u need to create a Java service for this…


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


  • 6.  RE: Listing files in directory

    Posted Wed July 25, 2012 05:29 AM

    streamToFile and stringToFile services are available from 8.x not in 7.x. You have to write custom java service in your environment. As suggested you can look into PSUtilities to see if it has services already built into it…

    HTH
    Senthil


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