SMS中显示的全球唯一ID

时间:2016-06-01 07:15:43

标签: text sms biztalk

我有一个包含phonenum和textmsg字段的平面文件架构。我们使用phonenum字段,我们将通过BizTalk发送textmsg。我们成功传递了这条消息,并且能够收到短信。但是在短信中有一个加密的文本,这是不必要的,必须删除。消息看起来像

  

{C5B3EAF6-2CF6-40AA-9118-20430843A0D0}您的一次性密码是123456。

我们如何删除{C5B3EAF6-2CF6-40AA-9118-20430843A0D0}?我们必须在Pipeline或Orchestration中配置一些东西吗?

这是我们在Construct Message中的代码:

msgSnd_SendSMStoCustomer.parameter = msgRcv_FlatFileSchema;
InMessage = xpath(msgSnd_SendSMStoCustomer.parameter,"string(//*[local-name()='textmsg'])");
msgSnd_SendSMStoCustomer(SMTP.EmailBodyText) = InMessage;
  • 其中msgSnd_SendSMStoCustomer.parameter是一个多部分消息类型,它将作为我们传递给BizTalk的消息的主体。
  • 我们将msgRcv_FlatFileSchema声明为消息类型,并在其中映射我们的平面文件架构。
  • InMessage是我们声明为System.Xml.XmlDocument的变量。
  • xpath代码中的textmsg是我们在平面文件架构中声明的消息体。
  • 我们在此处使用动态发送端口并使用自定义管道。我们的自定义管道内部是Assembler部分中的Flat File Assembler。而在Encode部分中有MIME / SMIME编码器。我们只使用Flat File Assembler和MIME / SMIME编码器中的所有默认设置。

1 个答案:

答案 0 :(得分:0)

使用XML Schema而不是Flat File解决了这个问题。然后我添加了一些类来将String转换为RawString。在此网站http://www.codeproject.com/Articles/36210/Sending-an-HTML-formatted-e-mail-message-from-Bi上获得了解决方案。当然,构造消息应如下所示:

stringPhoneNum = classHelper.getElement(msgRcv_SendSMStoCustomer, "phoneNum");
stringMessageBody = classHelper.getElement(msgRcv_SendSMStoCustomer, "messageBody");
msgSnd_SendSMStoCustomer.multiPartMessage = new Microsoft.BizTalk.XlangCustomFormatters.RawString(stringMessageBody);

SMTPUtils.Part.SetContentType(msgSnd_SendSMStoCustomer.multiPartMessage,"text/html");
msgSnd_SendSMStoCustomer(SMTP.From) = "noreply@noone.com";
msgSnd_SendSMStoCustomer(SMTP.Subject) = " ";
msgSnd_SendSMStoCustomer(SMTP.SMTPHost) = "host";

我故意将SMTP.Subject保留为“”,因为如果它为null或者根本没有声明,那么它将被GUID抢占。我还在web中获得了classHelper.getElement的代码。只需搜索“如何将xml转换为字符串”,你应该很好。

相关问题