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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  Filepolling Question

    Posted 05/18/11 08:51 PM

    Hello all

    in file polling monitoring Directory , i am expecting different file structures ( xmls)

    based on which i have to map different canonical s ,

    how can i find the document type from the stream to map accordingly

    thanks in advance


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


  • 2.  RE: Filepolling Question

    Posted 05/18/11 09:46 PM

    You’ll need to infer the doc type from the filename or the file contents.

    Often people want to use one directory for every type of file. A sort of “master” inbound directory. Alas, this usually isn’t a good approach for a variety of reasons. I would recommend considering using different directories and file polling ports for different doc types–one doc type, one file polling port for only that type.


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


  • 3.  RE: Filepolling Question

    Posted 05/19/11 05:41 AM

    Sadly Different folder structure or different filenames as all of them have same name pattern …

    so can you please let me know how to infer contents before converting to document type as i have set arrays option as true which requires to provide the document type name

    Thanks


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


  • 4.  RE: Filepolling Question

    Posted 05/19/11 05:55 AM

    Assign folder A to be the “inbox” for doc type A. Port A invokes service A, which assumes doc type A.
    Assign folder B to be the “inbox” for doc type B. Port B invokes service B, which assumes doc type B.
    And so on.


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


  • 5.  RE: Filepolling Question

    Posted 05/19/11 02:02 PM

    Thanks for the Suggestion,

    but all the files would be placed in a single folder … with single file polling port

    hence i want to find the way to find the document type from the input stream

    Thanks

    ravi


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


  • 6.  RE: Filepolling Question

    Posted 05/19/11 06:26 PM

    What is driving the desire to put all files into a single folder?

    Here are reasons to not do that:

    • Mingling of different types of files from different partners/applications can lead to mishandling of data/files.
    • The code to determine the type of file is more complex.
    • Cannot suspend processing for just one type of file/integration. It is all or nothing.

    That said, you can potentially do document recognition by examining the first 100 to 1000 bytes of the file. Open the file as stream and read however many bytes to get to data that you can use to determine the document type. Then you can close and reopen the file and process it with the right document type in the node to doc call.


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


  • 7.  RE: Filepolling Question

    Posted 05/20/11 03:27 PM

    its an legacy interface where application used to consume all the files from single folder .and client is Reluctant to change in that end …

    and as a solution i m routing the files to TN ,

    so i can now suspend any particular transaction if needed


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


  • 8.  RE: Filepolling Question

    Posted 05/20/11 05:12 PM

    Since you mentioned these were XML files, your file polling port service doesn’t need to do anything. Just pass the stream to TN and it will recognize the doc type using your TN document type definitions.


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


  • 9.  RE: Filepolling Question

    Posted 05/20/11 05:17 PM

    :slight_smile: done the Same , results are as expected

    thanks for your help


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