Hari,
I’m not sure how you are obtaining your XML document. If you are reading it from the file system using the pub.file:getFile service you may be setting the “loadAs” parameter to “stream” instead of “bytes”.
If you load the document from the file system as a byte array, you can convert it to a string using the pub.string:bytesToString service. You can then map the resulting string into the content variable inside the attachments recordList of the pub.client:smtp service. I set the contentType to “text/xml” and provided a filename to use for the attachment.
My working example looks like this:
Regards,
Mark Carlson
Conneva, Inc.
mcarlson@conneva.com
#Integration-Server-and-ESB#webMethods#webmethods-Protocol-and-Transport