Hello all. I took a quick browse through this forum and hadn’t seen anything posted about this particular issue, so I thought I’d see if anyone else out there is running into problems.
We’re trying to send an email containing HTML in the body (versus as an attachment) using Integration Server v4.6. When we do, the service we’ve created seems to “hang”.
We started with the sample.mime:build_SimpleMIME service (provided by webMethods as an example), and added a pub.client:smtp step at the end, mapping the MIME message stream created by the example to the mimeStream input parameter on pub.client:smtp.
When we do this, the service hangs (or possibly times-out … I’m not sure how long I should expect to wait for a time-out, but it runs for well over a couple of minutes).
The pub.client:smtp service does not complain about invalid input. I think that the output of the example is java.io.ByteArrayInputStream, which is the same thing that pub.client:smtp expects as input for mimeStream.
Is there something obvious we’re doing wrong? Has anyone got an example of using the smtp service to send MIME that they’d be willing to share?
Thanks in advance for your help.
It’s a timeout of some sort, apparently. If you wait long enough you get an error.
com.wm.app.b2b.server.ServiceException: java.io.IOException: [B2BCORE.0068.9109] Expected 250 got 451 Timeout waiting for client input
Presumably that means my MIME is malformed?
Hmmmmmm.
I’ve always sent strings or attachments.
Thanks for the reply, Ray.
wM has put a “streamToString” component into their example to convert the envStream into a string.
Here’s what is returned in the string:
Message-ID: 8206239.1024666624030.JavaMail.sapbc@odin
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary=“----=_Part_3_4365239.1024666624021”
X-DocType: alert
X-Severity: 9
------=_Part_3_4365239.1024666624021
content-type: text/html;charset=“iso-8859-1”
content-transfer-encoding: quoted-printable
ErrorWe were not able to process your requ=
est because the account number you gave us has
expired. Please corre=
ct the account number and resubmit your request.
------=_Part_3_4365239.1024666624021--
I know very little about this stuff, but nothing looks immediately suspect to me.
Curtis
hmmm…would you share your knowledge on how to create an attachment within the mime-stream (NOT applying it to the attachment in the smtp, but before when creating the message)
Sorry for not replying sooner - I’ve been to busy to monitor the board much.
There’s not much to it really.
The pub.client:smtp service has an attachments\content object record. You declare or map a string with your content in it. For HTML, use the runTemplateOnPipe or type HTML directly into your string. Use the stringToBytes service to convert your HTML into bytes, and map it into the the attachments\content input object on the smtp service, and set the attachments\content variable to “text/html”.
That should do the trick.
Good luck.
Hi Curtis.j.ling,
I have followed the same method wrting html in a string and converting that string to bytes and mapping the bytes variable to attachments/content and hardcoding the attachments/contenttype to “text/html” of smtp service but I was propmpted the below error:
“com.wm.util.values cannot be cast to java.lang.string”
Please help me resolve the issue.