I want to get the body of the email message (not the attachment) in my flow service. I have configured a port and it is connected to exchange server and everything looks okay. I send email to the given user and my flow service is invoked. If I save the pipeline to the file I see the email message in that.
Pls refer all threads before posting a new thread…
Anyways check these links,and make sure your email port settings are correct, and you have to extract the email body content(Stream).
[URL=“wmusers.com”]wmusers.com
[URL=“wmusers.com”]wmusers.com
Use debugging in the receiving flow service so first step would be getTransportInfo (no inputs needed)and nextstep is savepipelineToFile.Trigger an email via configured port and later use restorepipelineToFile and check the pipeline you should see the getTransportInfo/Email/content and all the other email headers like from,To,subject,contenttype etc…
So extract the content of the email body use these built-in services pub.io:streamTobytes,pub.string:bytesToString and further down follow upon your requirement.
java.lang.ClassCastException: java.lang.String at pub.io.streamToBytes(io.java:77) 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:585) at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:403) at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:630) 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:241) at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:51) at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:228) at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:30) at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:621) at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:535) at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:381) at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:237) 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:581) at com.wm.lang.flow.FlowState.step(FlowState.java:441) at com.wm.lang.flow.FlowState.invoke(FlowState.java:406) at com.wm.app.b2b.server.FlowSvcImpl.baseInvoke(FlowSvcImpl.java:1040) at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:630) at com.wm.app.b2b.server.util.tspace.ReservationProcessor.process(ReservationProcessor.java:46) at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsPro
Looks like you are trying to cast a string into a stream object. In your service, look for the step where you’re calling pub.io:streamToBytes. You are probably mapping the wrong variable into that service or maybe you don’t need that service at all (assuming your goal is to convert the stream into bytes and then the bytes into a string.)
I went through different posts but could not succeed in getting email message. Let me tell what I tried
Test-1
called getTransportInfo
mapped ‘transport/email/content’ to PSUtilities.stream:streamToString
Got mentioned exception
Test-2
called getTransportInfo
called createMimeData and mapped ‘transport/email/content’ to input
called getBodyPartContent passing 0 or 1 to ‘index’ - both tried
called PSUtilities.stream:streamToString passing ‘content’
content was null - go nothing
Test-3
define a object variable streamContent in the input of the service
called createMimeData and map streamContent to input
called getBodyPartContent passing 0 or 1 to ‘index’ - both tried
called PSUtilities.stream:streamToString passing ‘content’
content was null - go nothing
My goal was to get the body text of the email message. Going through various post in the forums I happened to experiment different things but none worked out for me yet.
It looks like getting email body text is not easy. Please let me know if you know any solution.
I’m trying the similar task and am wondering if you got your’s working?
If yes, can you please share what you had to do to get the content without the extra junk.