webMethods

webMethods

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
Expand all | Collapse all

How to execute wM service via FTP

  • 1.  How to execute wM service via FTP

    Posted Tue April 06, 2004 07:27 PM

    Hello All,

    I have a client who will be ftp’ing a flat file. The data in the file is fixed width. I would like to translate the file into a record so that I could insert the data into a database. I just don’t know how to get my flow service to work properly. Any ideas? I assume the client will write a script to ftp to the server put the file into the correct location (/ns/packagename/testFTP).

    Structure of the file:
    System Name 1-10
    Vendor Name 11-43
    Vendor Key 44-57

    Service: testFTP (Input=inputNode object)
    Steps ?


    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: How to execute wM service via FTP

    Posted Tue April 06, 2004 08:58 PM

    noyb,

    There are lot of discussions posted in this site about this procedure.you can use the search functionality and may find solution before posting.

    I believe you are using webMethods 4.6 server.

    First you need to create flatfile template or its ok if you already have it.

    your Service:testFTP (set Input=contentStream object)

    Flow Steps:Invoke the following
    pub.io:streamToBytes
    pub.string:bytesToString
    wm.b2b.edi:convertToValues (WmEDI Package service)

    HTH,


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 3.  RE: How to execute wM service via FTP

    Posted Tue April 06, 2004 09:24 PM

    Thanks RMG for the quick response. I was overwelmed with information after searching the forum. Thank you for your response.


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 4.  RE: How to execute wM service via FTP

    Posted Tue April 06, 2004 09:32 PM

    RMG,

    Don’t I need to create a map step to define my flatfile template? After that, where is it being used?


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 5.  RE: How to execute wM service via FTP

    Posted Tue April 06, 2004 09:32 PM


  • 6.  RE: How to execute wM service via FTP

    Posted Tue April 06, 2004 09:44 PM

    RMG,

    I was thinking. Instead of an object, shouldn’t my testFTP input service be just a string?


    #webmethods-Protocol-and-Transport
    #webMethods
    #Integration-Server-and-ESB


  • 7.  RE: How to execute wM service via FTP

    Posted Tue April 06, 2004 09:50 PM

    No,The input should be stream object,because when the flow service receives any .txt or dat file from FTP a java InputStream object will be loaded.So set the service input to contentStream object.

    Debug this if you want.

    HTH,


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 8.  RE: How to execute wM service via FTP

    Posted Tue April 06, 2004 10:24 PM

    RMG,

    I did what you said. I would I test to see it this works. I cannot use the “Test/Send XML File…”


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 9.  RE: How to execute wM service via FTP

    Posted Mon November 29, 2004 06:15 AM

    noyb,
    the test, send xml file is for XML files, not flat files. It attempts to convert the XML file into a node object, which is not going to work too well with a flat file.

    If you want to test your service, perhaps look at creating a service that takes in a String and converts it into a stream (look at the pub.io folder for the services) called contentStream, and then invokes your actual service. This will then simulate what will happen when they invoke your service via an FTP upload of the file.

    Alternatively you could have it take in a filename and read from that file using pub.file:getFile with loadAs set to “stream”. then just pass that returned stream as the input for your service.

    Regards,
    Nathan Lee
    WmUnit - The webMethods testing framework.
    [url=“http://www.customware.net/wmunit”]http://www.customware.net/wmunit[/url]


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport