Trouble to receive xml files via email


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:
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

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.


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:
XMLCoder decode invalid data type:

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.


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.


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.

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.


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.

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?



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 next and then after that you have to decide what to do with bytes…

Let me know if you have any questions

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:

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

Can anybody help me?

Thanks, Claire