Hi,
I am unable to extract excel file i.e., XLS file from e-mail as an attachment. I had gone through several posts but couldn’t get exact solution. I had configured the e-mail Listener in IS and created 1 flow service which will be invoked by listener. The following is the Pseudo code and I am convert the received data to XLS file in File system. I am able to get the file name of the attachment but failing to write the xls file to file system.
Note: there are no input or output declared for this service.
- pub.flow:getTransportInfo
- pub.mime:createMimeData (Input: //transport/email/content - from step1)
- pub.mime:getNumParts
- pub.mime:getBodyPartContent (input: mimeData from step 2)
Output: content object - pub.file:streamToFile (Input : filename, stream(from step4 output))
The following is the error message I am getting. I tried all possibilities of converting the content from Step 4 to bytes and bytes to file and still it is failing.
Could you let me know to resolve this issue.
2010-09-29 21:47:46 CDT [ISP.0090.0008C] 0 fileName {java.lang.String} = ‘ErrorLog’
2010-09-29 21:47:46 CDT [ISP.0090.0008C] 0 contentStream {java.io.ByteArrayInputStream} = ‘java.io.ByteArrayInputStream@414c4426’
2010-09-29 21:47:46 CDT [ISP.0090.0008C] 0 lastError {com.wm.data.ISMemDataImpl} =>
2010-09-29 21:47:46 CDT [ISP.0090.0008C] 1 error {java.lang.String} = ‘[ISS.0086.9250] Parameter [stream] is not of type: [InputStream]’
2010-09-29 21:47:46 CDT [ISP.0090.0008C] 1 errorType {java.lang.String} = ‘com.wm.app.b2b.server.ServiceException’
2010-09-29 21:47:46 CDT [ISP.0090.0008C] 1 errorDump {java.lang.String} = 'com.wm.app.b2b.server.ServiceException: [ISS.0086.9250] Parameter [stream] is not of type: [InputStream]
at pub.CommonUtils.getRequiredObjParam(CommonUtils.java:92)
at pub.file.streamToFile(file.java:793)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:439)
at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:635)
at com.wm.app.b2b.server.util.tspace.ReservationProcessor.process(ReservationProcessor.java:46)
at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:238)
at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:51)
at com.wm.app.b2b.server.invoke.PipelineProcessor.process(PipelineProcessor.java:171)
at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:272)
at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:30)
at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:390)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:539)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:384)
at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:234)
at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:189)
at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:324)
at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:584)
at com.wm.lang.flow.FlowState.step(FlowState.java:444)
at com.wm.lang.flow.FlowState.invoke(FlowState.java:409)
at com.wm.app.b2b.server.FlowSvcImpl.baseInvoke(FlowSvcImpl.java:1057)
at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:635)
at com.wm.app.b2b.server.util.tspace.ReservationProcessor.process(ReservationProcessor.java:46)
at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:238)
at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:51)
at com.wm.app.b2b.server.invoke.PipelineProcessor.process(PipelineProcessor.java:171)
at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:272)
at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:30)
at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:390)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:539)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:384)
at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:234)
at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:109)
at wm.server.net.EmailTransaction$RunService.write(EmailTransaction.java:1342)
at wm.server.net.EmailTransaction$RunService.run(EmailTransaction.java:1187)
at com.wm.util.pool.PooledThread.run(PooledThread.java:131)
at java.lang.Thread.run(Thread.java:619)
’
2010-09-29 21:47:46 CDT [ISP.0090.0008C] 1 service {java.lang.String} = ‘pub.file:streamToFile’
2010-09-29 21:47:46 CDT [ISP.0090.0008C] 1 user {java.lang.String} = ‘Administrator’
2010-09-29 21:47:46 CDT [ISP.0090.0008C] 1 time {java.lang.String} = ‘2010/09/29 21:47:46.183’
2010-09-29 21:47:46 CDT [ISP.0090.0008C] 1 callStack[0] {[Lcom.wm.data.IData;} =>
2010-09-29 21:47:46 CDT [ISP.0090.0008C] 2 service {java.lang.String} = ‘pub.file:streamToFile’
2010-09-29 21:47:46 CDT [ISP.0090.0008C] 2 flowStep {java.lang.String} = ‘’