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
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.
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.