file polling port

8
File Polling Port: About File polling port webMethods File Polling Setup and Usage 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.

Upload: sowmya-paleghar-n

Post on 21-Nov-2015

223 views

Category:

Documents


6 download

DESCRIPTION

whetever

TRANSCRIPT

File Polling Port:

About File polling port

webMethods File Polling Setup and UsageFile 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 SetupIn 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.

Service Setup

Create a flow service with one input:originalFileName

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 callpub.flow.getTransportInfofrom WmPublic. This will provide the filename information in:transport->filePolling filename originalFilename

At this point the filename will in the format of:/FilePolling..

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

For this parameter... Specify...Monitoring Directory Directory on Integration Server that you want to monitor for files.Working Directory (optional) Directory on Integration Server to which the server should move files for processing after they have been identified in the Monitoring Directory. Files must meet age and file name requirements before being moved to the Working Directory. The default sub-directory, MonitoringDirectory\..\Work, is automatically created if no directory is specified.\Completion Directory (optional)Directory on Integration Server to which you want files moved when processing is completed in the Monitoring Directory or Working Directory. The default sub-directory, MonitoringDirectory\..\Done, is automatically created if no directory is specified.Administering webMethods Integration Server Version 8.2 121 7 Configuring Ports 8 Under Security, in the Run services as user parameter, specify the user name you want to use to run the services assigned to the file polling directory. Click to lookup and select a user. The user can be an internal or external user.9 Under Message Processing, supply the following information:Error Directory (optional) Directory on Integration Server to which you want files moved when processing fails. The default sub-directory, MonitoringDirectory\..\Error, is automatically created if no directory is specified.File Name Filter (optional) The file name filter for files in the Monitoring Directory. The server only processes files that meet the filter requirements. If you do not specify this field, all files will be polled. You can specify pattern matching in this field.File Age (optional) The minimum age (in seconds) at which a file in the Monitoring Directory can be processed. The server determines file age based on when the file was last modified on the monitoring directory. You can adjust this age as needed to make sure the server does not process a file before the entire file has been copied to the Monitoring Directory. The default is 0.Content Type Content type to use for the file. The server uses the content handler associated with the content type specified in this field. If no value is specified, the server performs MIME mapping based on the file extension.Allow Recursive Polling Whether Integration Server is to poll all sub-directories in the Monitoring Directory. Select Yes or No.Enable Clustering Whether Integration Server should allow clustering in the Monitoring Directory. Select Yes or No.Lock File Extension (optional)Defines the polling for a particular extension.For this parameter... Specify...Enable Whether to enable (Yes) or disable (No) this file polling port.

Processing Service Name of the service you want Integration Server to execute for polled files. The server executes this service when the file has been copied to the Working directory. This service should be the only service available from this port.Important! If you change the processing service for a file polling port, you must also change the list of services available from this port to contain just the new service. See below for more information.File Polling Interval How often (in seconds) you want Integration Server to poll the Monitoring Directory for files.Log Only When Directory Availability ChangesIf you select No (the default), the listener will log a message every time the monitoring directory is unavailable.If you select Yes, the listener will log a message in either of the following cases: The directory was available during the last polling attempt but not available during the current attempt The directory was not available during the last polling attempt but is available during the current attemptDirectories are an NFS Mounted File SystemFor use on a UNIX system where the monitoring directory, working directory, completion directory, and/or error directory are network drives mounted on the local file system.If you select No (the default), the listener will call the Java File.renameTo() method to move the files from the monitoring directory to the working directory, and from the working directory to the completion and/or error directory.If you select Yes, the listener will first call the Java File.renameTo() method to move the files from the monitoring directory. If this method fails, the listener will then copy the files from the monitoring directory to the working directory and delete the files from the monitoring directory. This operation will fail if either the copy action or the delete action fails. The same behavior applies when moving files from the working directory to the completion and/or error directory.Cleanup Service (Optional) he name of the service that you want to use to clean up the directories specified under Polling Information.For this parameter... Specify...Administering webMethods Integration Server Version 8.2 123 7 Configuring Ports 10 Click Save Changes.11 Make sure the port's access mode is properly set and that the file processing service is the only service accessible from the port.a In the Ports screen, click Edit in the Access Mode field for the port you just created.b Click Set Access Mode to Deny by Default.c Click Add Folders and Services to Allow List.d Type the name of the processing service for this port in the text box under Enter one folder or service per line.e Remove any other services from the allow list.f Click Save Additions.Note: If you change the processing service for a file polling port, remember to change the Allow List for the port as well. Follow the procedure described above to alter the allowed service list.g If you change the processing service for a file polling port, remember to change the Allow List for the port as well. Follow the procedure described above to alter the allowed service list

Cons:service.getcallingservice uses