Skip to Content
0
Former Member
Mar 29, 2009 at 02:32 PM

Converting Excel to XML in Module Processor

55 Views

Hi,

I am trying to convert excel to XML in the Module. I am using the POI HSSF for reading the incomming excel file and returning an XML as message from the module.

XMLPayload payload = message.getDocument();

byte[] byteArray = payload.getContent();

InputStream inputStream = new ByteArrayInputStream(byteArray );

HSSFWorkbook workbook = new HSSFWorkbook(new POIFSFileSystem(inputStream), true);

The above code is gives the error : Error: java.io.IOException: Invalid header signature; read 0xC2A0C3118FC390C3, expected 0xE11AB1A1E011CFD0

As per my assumption the error could be caused because of one of the two reasons mentioned below:

1. The byteArray i am getting is corrupted on its way.

2. The communication channel is not configured correctly (currently configured as below: Message Protocol: File, File Type: Binary)

The above two reasons seems to be correlated.

If you agree that the reasons mentioned above are correct, please suggest appropriate configuration.

In case you disagree with the reason of the above error, please share the correct solution.

Regards,

SK