I am just starting out with WEBMethods. I am starting on a project that will need to poll a drive on my companies M: drive location. The file will arrive randomly from the mainframe and I will need to have WEBMethods some how pulled the file from the drive location.
Once I have to move the file from one location to another before I start my parsing of the file.
If I had more code I would post it, but WEBMethods is new and so far I actually have not writen any code in WEBMethods but I am extremely code with Java.
Drive location:
M:\tempTest\NewDriveLocation\ThisIsTheFileINeed
I need to be able to have a transform that pulls in a file from any directly location on Friday. I have an input retieve on my MAP but have not figured out how to enter the file path so that it can find the file.
Software AG's webMethods Integration Server has a built-in feature called a File Polling Port, which you can configure to monitor a local or network shared directory for new files. The Integration Server Administrator's Guide instructions for how to set up a File Polling Port are as follows:
The Processing Service referenced above is a service which you must develop.
If you are processing XML files with the File Polling Port, the file will be parsed prior to invoking your service, so you should create a service which has a single input argument of type object called
node
(which is the parsed XML document). You can then use the pub.xml services in the WmPublic package (such aspub.xml:xmlNodeToDocument
to convert thenode
to an IData document) to process the providednode
object. Refer to the Integration Server Built-In Services Reference for details on the pub.xml services.If you are processing flat files (which is anything other than XML in webMethods), the File Polling Port will invoke your service with a java.io.InputStream object from which you can read the file contents, so you should create a service which has a single input argument of type object called
ffdata
. You can then use the pub.io services in the WmPublic package (such aspub.io:streamToBytes
to read all data in the stream to a byte array) or the pub.flatFile services in the WmFlatFile package (such aspub.flatFile:convertToValues
to convertffdata
to an IData document) to process the providedffdata
object. Refer to the Integration Server Built-In Services Reference for details on the pub.io services, and the Flat File Schema Developer's Guide for details on the pub.flatFile services.If both XML and flat files are being written to the monitored directory, you can either write a service which optionally accepts both a
node
andffdata
object and check which one exists in the pipeline at runtime and process accordingly, or you can create two File Polling Ports which monitor the same directory but check for different file extensions (ie. *.xml and *.txt respectively) using the File Name Filter setting on the port.If you want to poll a Windows file share, you can specify the directory using a UNC file path (such as
\\server\directory
) on the File Polling Port.Also, you need to make sure the user account under which Integration Server executes has appropriate file access rights to the various directories configured on the File Polling Port.