Hi,
I have configured a file polling port. My service which is used to process inbound files, has input variable as ‘ffData’ of datatype object. My service internally invokes “convertToValues” method as first flow step. So I have mapped My Service’s input variable ‘ffData’ to the input variable of service ‘ConvertToValues’ whichi is “ffData”, too.
Now when I put a text file to process in “inbound” directory, file polling port reads the file and puts in “error” directory. I get the error message in server.log file as:
Error Processing Service : “Input parameter ffData cannot be null.”
I think that correct variable name has to be ffdata defined as object not ffData. It is pipeline and its case sensetive.
To really test it put savepipelineToFile service at start of your flow service and run your poller again. Next disable or replace this with restorePipelineFromFile builtin service and step through your flow after this service see what is in pipeline. you should see ffdata although this stream object may be invalid now but its just to test if your poller actually got the file and passing data to your flow.
Hello,
I am interested in invoking a service, when a file is ftped to the FTP port of the SAP BC!
I have created a new port for FTP will Allow by default settings
The service has the input parameters ffdata(type String)
The first step of the service is savePipelinetoFile with filename dummy.txt
Using the IP address and port number, I try to FTP a test file into location /ns/<folder>/<service>
Result : The pipeline contains only the filename used for saving the pipeline.
“1. convert *input from stream to bytes using pub.io.streamToBytes”
There have been a number of posts talking about “converting” streams to bytes. Strictly speaking, this is not a “conversion” (even though the wM docs refer to it that way too). One reads from a stream to get the bytes–this is an I/O operation. I point this out only to help people realize what a stream really is so they can understand what they can and cannot do with it.
Depending on the service needs, one may not need to read the the entire stream by calling streamToBytes. Indeed, in the steps outlined by Satya above, reading the stream into a byte array is unnecessary. The convertToValues service accepts the ffData input parameter, which can be a String, an InputStream or a ByteArray. Just pass along the ffdata variable to convertToValues and it will work.
This is particularly important to do if the file is considered large and one uses the node iterator services to processes parts of the file at a time. If one reads the entire stream into memory, then you’ve defeated the purpose of using streams and node iteration.
The fun part is that the file polling port puts “ffdata” in the pipeline. And convertToValues accepts “ffData”. One must pay close attention to that character case difference.