I use IS 6.1 and I am having problem handling Excel email attachment. I scanned through the posts on this forum but could not find the hint I am looking for.
I first defined a file poller that retrieves an Excel file from my file system and I wrote a service that takes the “ffdata” object as input and then transform the Excel file into a java arraylist using the POI open source libraries. Another step then converts the arraylist into a webMethods document for further processing. This works fine.
Then I tried doing the same by replacing the file polling by email polling (receiving an Excel file through an email). So I defined an email poller that scans my pop3 mailbox and set the following properties:
- Invoke service for each part of multipart message = yes
- Include email headers when passing message to content handler = no
To test this process, I simply send out an email from my Outlook client, containing a single Excel file attachment and my fully qualified service name as subject. I made no change to my existing flow service that still takes a “ffdata” object as input parameter.
However my flow service does not work anymore in this situation, it always crashes in my java code while manipulating the “ffdata” input stream to transform it into a java arraylist: “java.io.IOException: Unable to read entire header; 217 bytes read; expected 512 byte” (I debugged my java code that fails on the line “wb = new HSSFWorkbook(fileStream);”. I suppose that my java code is correct as it works fine when getting the input stream directly from the webMethods file poller.
I also tried to create a MIME object, get the number of parts, iterate on each part and then get the part body contents before invoking my Excel to java conversion service but this does not work any better.
I also created a flow service that sends out my Excel file using the webMethods smtp api but no change, still same issues…
Does somebody have an idea what the cause of my problem could be? I attached my package to this post.
PS : in order to be able to upload my package on this forum (size limitation) I had to remove the external jars from my code/jars package directory. If you want to run it, you’ll need (you can get them from the jakarta web site):
Package demonstrating the problem
DemoTNInbound.zip (25.5 k)