filepolling problem

Hi,
i am facing problems while working filepolling with xml. i have tried many ways but i am not getting where exactly error is comming.always the given xml file is moving into error directory.
i set the content type all of the possible ways.

  1. application/xml
  2. text/xml
  3. no content type
    i tried many ways by giving the input pipeline variable of the service as
  4. ffdata(object)
  5. node(object)
    can u please tell me how to rectify this.

i couldn’t find the documentation from advantage… site .where can i get the documentation related to this (filepolling wih xml).i would like to know the exact process.how can i handle error when any error comes while processing.

i tested for flatfile whether it is working or not.i set the content type as application/x-wmflatfile and pipeline variable as ffdata.interestingly it is working fine.but in the case of xml i am getting problems.

Adv Thanks,
chandu

“i set the content type as application/x-wmflatfile and pipeline variable as ffdata.interestingly it is working fine.but in the case of xml i am getting problems.”

What happens in this case? With the content type set to application/x-wmflatfile you should always get an ffdata object, even when the file contains xml. Is that not happening?

If you don’t specify a content type on the the file polling port, the filename extension is used to determine the content type and the content handler. In this case, the service that is invoked will need to determine which pipeline variable is present (e.g. ffdata, node, content, etc.) and take the appropriate action.

The IS Administrator’s Guide has information on the file polling port. The Flat File Schema Developer’s Guide has information for flat files.

Hi reamon,
thanks for the reply.i tried by putting flatfile (csv) in the monitoring directory and set the parameters content type as application/x-wmflatfile and pipeline variable as ffdata.it worked fine.but in case of xml its not working.what would be the content type for processsing xml and what would be the variable i need to take.

Regards,
chandu

Content-type = text/xml
Input variable = node

Monitor your server log next time the file polling runs. If the file is being moved to the error directory, then an error must be occurring, and most likely, it is being written to the server log. Once you discover what the error is, post it here.

  • Percio

Keep in mind that if you set the content type for a particular file polling port, all files must be of that content type. If you toss an XML file into a directory being monitored by a polling port configured with application/x-wmflatfile as the content type, you’ll still get an ffdata object (an InputStream) and not a node.

If you need to process multiple types of files, you have a couple of choices:

  1. as Percio described, create a file polling port for each type, setting the content type as needed; each port will need to monitor its own directory (e.g. can’t have 2 ports monitoring the same directory)

  2. create one file polling port with an empty content type; the polling port will invoke the appropriate content handler based on the file extension; so foo.xml will cause a node object to be placed in the pipeline, while other extensions will cause other vars to be put in the pipeline, depending on the content handler associated with the file extension

Rob,

Not that I think it’s a good idea to have two polling ports monitor the same directory, but if the file name extensions are known, you could theoretically monitor the same directory with two separate polling ports as long as the “File Name Filter” is used, right?

Thanks,
Percio

Yes, that would work.

Hi reamon and others

sorry for late reply.thanks for your cooperation.i got it now.
i have given pipeline variable as node (object)
and content type as text/xml
now it is working pretty good.

Regards,
Chandu

A 3rd option:

  1. Specify application/x-wmflatfile as the content type in the file polling port. Then use some mechanism to determine what kind of file you really have (e.g. csv, xml, txt, etc.) and process it as needed. One obvious way of determining what you have is by the incoming filename. Another way would be to read the first few bytes of the stream (you’ll need to read it in such a way as to be able reset the stream to the beginning for processing–there are a couple of ways to do that).

File Polling Problem

In server log I’m getting this error [666]2012-03-23 20:02:10 IST [FF.0001.0033C] Error processing service: [FPL.0002.0004] Server Error:
What does this mean.

When I’m trying to monitor a file using file polling it is moving to error Dir.
Please help me

Can you give few more details about your flow service …

First of all i have created a flow service to send a ff to IS via file polling
In developer I’ve created a fs with name readFileTest

pub.io:streamToBytes
pub.string:bytesToString
pub.flow:debugLog

i have created this flow service inside “ffmonitorsample” folder, and name of the service is readFileTest

After that i have created a file polling port on IS

for that what i did is

Security>ports>Add Port>webMethods/FilePolling>submit
Package name WmRoot
Run services as user Developer/Administrator
Monitoring Directory as C:\Users\Vimala\Desktop\mon
Working Dir C:\Users\Vimala\Desktop\mon\work
Completion Dir C:\Users\Vimala\Desktop\mon\done
Error Dir C:\Users\Vimala\Desktop\mon\error
Processing service ffmonitorsample:readFileTest
File Polling Interval (seconds) 5
Log only when directory availability changes No
Directories are NFS mounted file system No
Cleanup Service (optional) unspecified
Cleanup At Startup Yes
Cleanup File Age (optional) (days) 7
Cleanup Interval (optional) (hours) 24
Maximum Number of Invocation Threads 5
Content Type (optional) application/x-wmflatfile

Port Service Access Settings
Access Mode Allow by Default

Enabled the package

When I’m polling a file into the monitoring Dir it is moving to error

And I’m seeing a message on the server log as
[341]2012-03-25 14:57:38 IST [FF.0001.0033C] Error processing service: [FPL.0002.0004] Server Error:

Note: The same program is working fine on another system

I take it that IS is running on your local machine. Is it running as a Windows service? If so, what is the “Log on as” setting?

My guess is this may be a permissions issue of some sort because the IS process doesn’t have access to the Users directory. But that’s a guess.

Hi Krishna,

Please check the below link hope it helps …
http://www.wmusers.com/forum/showthread.php?17117-Filepoller-Processing-Service

Thanks,
Amol.

Hi all
im new new to webmethods
im working on building a service where i can enable/disable file polling from a dsp page.
i have used ports.listListeners
than LOOP over /listeners
->BRANCH on /listeners/protocol
–>FilePolling:SEQUENCE
—>listenerDisable
when i run it i get message The parameter ‘port’ is required.
file polling as far i know doesnt has any port no
and in the listListeners port for file polling shows as 0
when i pass 0 i get msg “Nothing is listening on 0”
disable doent work :frowning:
someone please help

this is UAT server running on unix (solaris)
n wher do i check the log on as?
i have logged in as Administrator
n thanks for the quick reply… appreciate it