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

Trouble to receive xml files via email

  • 1.  Trouble to receive xml files via email

    Posted Wed September 10, 2003 12:19 PM

    Hi,

    I am trying to receive xml files from an email attachment.
    My email port seems to work fine.

    I made a receiving service with a getTransportInfo Step and a SavetoPipeline Step.
    I defined an input object named ffdata.
    The pipeline has some contents but there is nothing about the attachment file.

    The errors I have in the logging console are :
    XMLCoder decode invalid data type: java.io.ByteArrayInputStrea
    XMLCoder decode invalid data type: com.wm.lang.xml.Document

    What can I do ?
    I didn’t set anything about the content-type since I am sending the emails with outlook for testing.

    Thanks for any help.

    Jonathan Barrier


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


  • 2.  RE: Trouble to receive xml files via email

    Posted Wed September 10, 2003 04:21 PM

    Hi Jonathan,

    Input should be object and variable name as “node”. webMethods xml handler assigns content to node variable name, so you have use that variable name. Make sure that when you are sending xml document as a attachment in the email, email format should be text/plain only.

    Let me know if any questions.

    -Srujan


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


  • 3.  RE: Trouble to receive xml files via email

    Posted Wed September 10, 2003 05:27 PM

    Hi Srujan,

    I tried to change the input of the processing service to an object named “node”. But the result is almost the same.

    The errors logged are now :
    XMLCoder decode invalid data type: java.io.ByteArrayInputStream
    XMLCoder decode invalid data type: java.io.ByteArrayInputStream

    I changed the email format to text in Outlook but it doesn’t change anything too. What about the extension of the attached file. Can I leave it to .xml ?

    I have read that I should set the email content-type to application/x-wmflatfile. Is that right ? How is it possible with outlook ?

    Thanks for your help.

    Jonathan


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


  • 4.  RE: Trouble to receive xml files via email

    Posted Wed September 10, 2003 05:47 PM

    Hi Jonathan,

    The attachment file need to have .xml extension in the email. In your receiving service call recordToDocument(v4.6 IS) or documentToxmlstring(v6.* IS) and after that put a smtp service to send an email to your self.
    I am not sure where you read the email content-type to application/x-wmflatfile. As i know outlook can support text/plain, richtext and text/html. You have to select text/plain using Format option in the window.

    -Srujan


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


  • 5.  RE: Trouble to receive xml files via email

    Posted Wed September 10, 2003 06:18 PM

    Sorry, probably I haven’t been precise enough.

    What I want to do is to send email with an xml file in attachment from MS outlook (or any email client) to webMethods, using the email port of webMethods 6.

    I read the email content-type to application/x-wmflatfile in the ISFlatFileSchemaGuide, chapter 5.

    Are you sure about the documentToxmlString receiving service since I should have an object in input ?
    Probably you mean xmlNodeToDocument ?

    Thanks for your help.


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


  • 6.  RE: Trouble to receive xml files via email

    Posted Wed September 10, 2003 06:29 PM

    Hi Srujan,

    I just managed to make it work using the xmlNodeToDocument service.
    What is surprising is that I still have an error in the logs (the same as before).

    Anyway, I have my file.

    Thanks for your help.

    Best regards.

    Jonathan


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


  • 7.  RE: Trouble to receive xml files via email

    Posted Wed September 10, 2003 07:23 PM

    SavePipelineToFile does XML serialization of object that have a number of different interfaces defined. com.wm.lang.xml.Document does not support any of these interfaces, therefore, if this object is in the pipeline when SavePipelineToFile is called you will get those warnings and the object will not be included in the saved pipeline.

    Generally, you will be operating on the output of xmlNodeToDocument, so
    if you no longer need the node object, drop it from the pipeline before calling SavePipelineToFile and the warnings will go away.


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


  • 8.  RE: Trouble to receive xml files via email

    Posted Wed September 10, 2003 08:39 PM

    Hi folks,

    Is there any limitation about the attachment?
    I mean … I need to receive an e-mail with a PDF file attached and this file must be FTPed to some MarketPlace … Is there any way to do this using wM?

    TIA


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


  • 9.  RE: Trouble to receive xml files via email

    Posted Wed September 10, 2003 09:35 PM

    Hi,

    In PDF case, you can send email attachment with text/plain format with *.pdf. Any none xml documents goes to common handler which is non xml handler.

    In that case on your service create a variable of type Object with name “contentStream” which receives stream bytes so have to use pub.io.bytesToStream next pub.io.streamToBytes and then after that you have to decide what to do with bytes…

    Let me know if you have any questions


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


  • 10.  RE: Trouble to receive xml files via email

    Posted Mon September 22, 2003 11:46 AM

    hi all,

    I’m also receiving an xml file in attachment. The email port works fine, but when I do a xmlNodeToDocument, this doesn’t do anything…

    What I have so far is:
    savePipeline
    getTransportInfo
    xmlNodeToDocument

    This doesn’t give a document?
    The bytesToStream gives an error “ClassCastException”

    Can anybody help me?

    Thanks, Claire


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