webMethods

webMethods

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

Text Email Attachment

  • 1.  Text Email Attachment

    Posted Wed January 21, 2004 09:11 PM

    Hi, I am wanting to receive an email attachment and get the contents of the attachment as a String. I have set up an email listener and am able to get the email from the getTransportInfo service. But it is still unclear to me as to how I get the attachment. I have attempted to get the transport/email/content and run a streamToBytes and a bytesToStream but this does not seem to help. Do I have to implement a custom content handler (I would prefer not to have to do this, b/c of time constraints). Thanks in advance.


    #webMethods
    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB


  • 2.  RE: Text Email Attachment

    Posted Wed January 21, 2004 09:56 PM

    What type of attachment you want to get. Is it a word doc, excel or simple text/html. You might want to set up the mime data and content type according to your needs/attachments.
    Check the service in WmSamples package under mime folder. That would help.

    cheers


    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport
    #webMethods


  • 3.  RE: Text Email Attachment

    Posted Wed January 21, 2004 11:08 PM

    Thanks for you help! I was able to use the streamToString service in the WmSamples package and this worked. Not sure why yet, but it worked. Thanks again.


    #webMethods
    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport


  • 4.  RE: Text Email Attachment

    Posted Thu June 17, 2004 02:11 AM

    Has anyone ever tried calling the getTransportInfo service and found that the InputStream supposedly containing the contents of the attachment is null???


    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB
    #webMethods


  • 5.  RE: Text Email Attachment

    Posted Thu June 17, 2004 02:32 PM

    Can you please elaborate a bit more on the question?
    What is the your process doing?
    Generally the contentStream will be in the pipeline and so we have to extract the data using this for textfile email attachment.

    Regards,


    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: Text Email Attachment

    Posted Fri June 18, 2004 01:24 AM

    RMG,

    I wrote a service that calls the pub.flow:getTransportInfo service to get the email attachment information onto the pipeline (the service is associated with an email port). The “transport” record returned should contain the email attachment as an InputStream Java object in the field transport/email/content, but it is set to null instead.

    I’ve used the InputStream object called “contentStream” that is mapped onto the pipeline by the content handler, but now I need to get the filename of the attachment for audit purposes but this is no longer available.

    My question is… is it possible to still get the other information about the attachment, information that is normally returned by the getTransportInfo service?

    Anything you can suggest would be greatly appreciated.


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 7.  RE: Text Email Attachment

    Posted Fri June 18, 2004 02:30 PM

    I believe you can extract the email attachment filename from the pipe (transport/email/filename)of the getTransportInfo service.
    put a savepipeline after the getTransport service and you will see it.

    HTH,


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 8.  RE: Text Email Attachment

    Posted Mon June 21, 2004 04:05 PM

    I dont know why the getTransportinfo service not showing filename parameter in the pipeline which it is supposed to show.
    Can you upload the Email port settings screenshot?So that i can check the settings.

    HTH,


    #webMethods
    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport


  • 9.  RE: Text Email Attachment

    Posted Tue June 22, 2004 02:12 AM

    RMG,

    I’ve attached a screenshot of the port settings. Hope this helps to explain why things aren’t working as they should.

    Thanks again.

    email port screenshot
    emailport_screendump.zip (46.6 k)


    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB
    #webMethods


  • 10.  RE: Text Email Attachment

    Posted Tue June 22, 2004 02:31 PM

    Paolo,

    I have checked the settings and there is one change that i request you to test which is shown below.set this setting to No instead of Yes.

    “Include email headers when passing message to content handler”—No

    remaining other settings are looks fine.

    If possible specify the PackageName as WmRoot.

    HTH,


    #webmethods-Protocol-and-Transport
    #webMethods
    #Integration-Server-and-ESB


  • 11.  RE: Text Email Attachment

    Posted Wed June 23, 2004 08:54 AM

    RMG,

    Sad news. I tried changing the “Include email headers…” setting to “No” and even changing the Package Name to WmRoot, but still got the same results.

    Interestingly enough, SAP have (finally!) sent me back a reply to an OSS note I created regarding this issue (attached), which seems to give an explanation as to why I’m getting the results I am r.e. the content of the attachment being null.

    What I’ve inferred from their reply is that if I want to get all of the information about every single attachment I get sent all of the time, I’m going to need to:

    1. Create a new mime type X/Y in the sapbc/Server/lib/mime.type file to associate the attachment name to my new mime type, and
    2. Register a custom content handler for the X/Y mime type to process the raw email contents.

    I know I’ve probably worn out my welcome with this, but I’d really appreciate your comments on this plan of attack. I’ve tried playing with content handlers from the basic SAP example, but I dont have any documentation or practical examples on how to implement one.

    Thanks for your patience… :wink:

    SAP OSS note reply
    012002523100002255342004.txt (3.4 k)


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport