problem while downloading .csv files from FTP Location

Posted by chetanparekh on 11-Nov-2010 02:19

Currently I have created Custom FTP service to download file from FTP location.

When it downloads xml file it works fine but when it download other types of file for example .CSV files.

It copies data from it in xqmessage and at the initial part of the message "Unable to parse XML content: Content is not allowed in prolog.
Content:".

I dont want this message in message.Can anybody suggest solution for it?

I am attaching message which I am getting at destination here in text file.In this example I have downloaded .CSV file from FTP location.

MessagefromFTPDownloadService.txt.zip

All Replies

Posted by tsteinbo on 11-Nov-2010 06:52

Well, we don't know the custom FTP service so it is hard to comment. But it seems that it is trying to do some XML parsing. Since this fails it forwards both the error message and the original content.

Have a look at the implementation of the service.

Thomas

Posted by chetanparekh on 11-Nov-2010 08:06

Here with I have attached Java file of customer service.

Posted by tsteinbo on 11-Nov-2010 09:38

The method dispatchMessage has this code

        XQPart part = message.createPart();
        part.setContentId("ftp_download");
        String txt=null;
        txt = new String(content, "UTF-8");
        part.setContent(txt, XQConstants.CONTENT_TYPE_XML);

e.g. it assumes it is picking XML...

Thomas

Posted by Admin on 05-Apr-2011 23:25

Hi CHetan,


I am new to the Sonic Workbench and would like to know how the file pickup is taking place from FTP. Could you please let me know how the custom service that you have written works and how I can duplicate it?

Any help would be appreciated. Thanks in advance.

Regards,

Sushanth

This thread is closed