File polling port is configured from admin console, Used to polls for the file in the configured directory.
When we get files from business
partner ( they ftp files into a directory).. so in your IS.., we have security->ports->filepolling so here we need to give some inputs..,like directory path and file type, service to invoke etc.. based upon the Dir path IS will monitor that path and when it comes to know that files that we are waiting for are present.., it picks that files and invokes the service.
File Polling Port Setup
In IS Admin console, look under security->ports. Click "Add Port" and select webMethods/FilePolling. Now you are at the File Polling listener configuration screen.
Leave the package name as WmRoot.
The monitoring directory is the location you want to look for files.
The working, completion and error directories are all optional (sort of). If you do not specify them, then they will default to the /../. I prefer to specify them explicitly.
Processing Service is the name of the service that will be called when a new file is placed in the monitoring directory (and the polling schedule hits).
File Polling Interval is how often the poller checks for a file. Times of 1 second are not recommended.
Once that is done, you need to save changes, then enable the port. If you don't have write permissions to the directories in the config (or the implicit directories if you didn't specify the optional directories) then you will get an error.
Create a flow service with one input:
This is put on the pipeline when the service is called, though not necessary as it also comes in the next step.
You then want to call pub.flow.getTransportInfo from WmPublic. This will provide the filename information in:
At this point the filename will in the format of:
Now you can do any file operations you'd normally do on a file and process it however you want.
If your flow service exits and signals failure, the file will be moved to the error directory.
If your flow service exits correctly, the file will be moved to the completion directory.
Access Mode Setup
Once you have your port setup and configured and your service created, you need to enable access from the file poller. Go back to the IS Admin screen in Security->Ports and edit the Access Mode of your file poller.
Click to "Add Folders and Services to Allow List" and paste in the fully qualified flow service into the left column and click "Save Additions".
Without this step you will get access denied errors when your file poller tries to run.
It's not hard, but it sure wasn't straightforward the first time I looked at it.