IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Reciving and Reading an Email

  • 1.  Reciving and Reading an Email

    Posted Tue September 21, 2004 11:22 AM

    Hi WmUsers !!!

              Got a small question ;). I am very much able to send mails from my IS. But how do i RECIVE AND READ THE CONTENTS OF THE MAIL ????????  
    

    I know its possible… but how do i do it ??

    Can any body just brief me about that ??? <urgent>

    Thanks in Advance
    Junior Wm User.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Reciving and Reading an Email

    Posted Tue September 21, 2004 11:36 AM

    Shan,

    You will need to configure an email listener on the IS. The listener can invoke a service for each attachment or one for the entire email. The latter will allow you to parse the MIME yourself using the built-in services.

    HTH,
    Jordy


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 3.  RE: Reciving and Reading an Email

    Posted Tue September 21, 2004 12:33 PM

    Hi Jordy !

    Thanks for the Immediate Reponse.I have created an email Listner on the IS.

    Now how do i start ? from where ?? to parse the mail ??? ah ??
    how do i use the getTransportInfo() ??? this is where i land in confusion…
    plz bear with me … since i am totally beginner to WM.

    Thanks in Advance !
    Junior Wm User.
    Shan.K.S


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: Reciving and Reading an Email

    Posted Tue September 21, 2004 02:27 PM

    Hi,

    Here are the steps to be followed.

    1. specify variable inputstream of object type in Input/Output section.

    2. invoke getTransportInfo as the first step.

    3. invoke streamToString from WmSamples package to convert the email stream to string.

    4. use this string to process.

    Regards,
    kalyan


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 5.  RE: Reciving and Reading an Email

    Posted Tue September 21, 2004 03:01 PM

    Shan,

    Please Dont cross the posts…you have posted the same question in other thread too few days back and posted responses by us…

    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.

    Make sure everything is set.

    HTH,
    RMG.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 6.  RE: Reciving and Reading an Email

    Posted Fri September 29, 2006 11:06 PM

    hi
    when i’m using getTransportInfo, save pipeline
    i would get only the http transport info
    how could i get the smtp transport info
    i’m using imap type

    Your early help is appreciated


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 7.  RE: Reciving and Reading an Email

    Posted Mon October 02, 2006 03:03 PM

    It should have Email port headers info,please check the pipelineout of that service.

    RMG–


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 8.  RE: Reciving and Reading an Email

    Posted Tue October 03, 2006 12:47 PM

    i’ve checked that, even though it’s only giving http results


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 9.  RE: Reciving and Reading an Email

    Posted Fri May 16, 2008 03:35 PM

    "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. "

    After call getTransportInfo I call

    pub.io:streamTobytes passing “transport/email/content” as input to this service. I get following exception in IS log - I am stuck and need urgent help - thanks!

    pub.io:streamToBytes java.lang.ClassCastException: java.lang.String

    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


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 10.  RE: Reciving and Reading an Email

    Posted Thu February 18, 2010 07:04 AM

    Can you kindly post the solution for this issue for extracting body of the message only in email? I am encountering the same error, in the contentStream variable, it says ‘java.io.ByteArrayInputStream’ as string instead of the stream object,
    When trying to use StreamToBytes followed by BytesToString, I am encountering the class cast exception,

    Thanks in advance, this is very urgent,

    regards,
    Chitra


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 11.  RE: Reciving and Reading an Email

    Posted Thu February 18, 2010 04:33 PM

    in pipeline of the email processing service, IS will give you either:
    contentStream
    or
    ffdata
    both are object type, you can use:
    pub.mime:createMimeData

    then in mimeData, you got:
    mimeData/part/content
    this content is Stream, use pub.io:streamToBytes to get the body of the email.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 12.  RE: Reciving and Reading an Email

    Posted Thu November 17, 2011 02:39 PM

    Its not inputstream. It’s contentStream. This must be placed in the service input variable stack.

    The getTransportInfo doesn’t do anything it only says the input variables of the service it’s an info service not one for actual content retrieving.

    To actually get something useful out of it one must pass it’s contents to MIME object from there you can extract body part, attachments, etc! This is achieved recurring to the get… functions on the WMPublic MIME folder read the manual (built in functions :)) for further instructions.

    Connect (contentStream ↔ input [createMIMEData]).

    Kaylan I’m complementing your info so that future readers get the problem solved quicker.

    Cheers,


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 13.  RE: Reciving and Reading an Email

    Posted Mon September 10, 2012 06:56 PM

    Hi RMG,

    I’m working on a similar project and I tried the steps as per you suggested. When I try to extract the content of the email, I get much more extra junk characters along with the content. Is there a way to get exactly just the content of the email?

    Appreciate your help as always!

    Thanks,
    Himanshu


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 14.  RE: Reciving and Reading an Email

    Posted Mon September 10, 2012 09:05 PM

    Check this:
    To actually get something useful out of it one must pass it’s contents to MIME object from there you can extract body part, attachments, etc! This is achieved recurring to the get… functions on the WMPublic MIME folder read the manual (built in functions :)) for further instructions.

    If you need further help I think I still have the package where I did this (have to check) I can email it to you.

    Cheers,


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 15.  RE: Reciving and Reading an Email

    Posted Mon September 10, 2012 09:49 PM

    Thanks for your reply Luis!

    I’m still trying to figure it out. If you don’t mind, please send me the package that you may have. It will be greatly helpful. My email address is: hpurandare@gmail.com

    Thanks for your help.

    Thanks,
    Himanshu


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 16.  RE: Reciving and Reading an Email

    Posted Mon May 15, 2017 10:02 AM

    i am getting error as ,Failed to start EmailListener:pop3:xxxxxx@gmail.com:25: [ISS.0070.9003] Enable failed: Could not log into account xxxxx@gmail.com. while create new port on IS Admin.

    could you please help here any one on this…


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 17.  RE: Reciving and Reading an Email

    Posted Fri December 14, 2018 03:28 PM

    Hi chitrag,

    Did u get the solution. I am facing the issue myself.

    Thanks
    Preethi


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services