如何删除短信中的<string>

How to remove <string> in SMS

我有一个 BizTalk 解决方案,一旦他们 phone 在我们的系统中注册,就会向我们的客户发送短信。不幸的是,短信会像这样包含 XML 标签。

您的密码是 1234。

如何删除短信中的 标签?我已确保我的 Orchestration 中的 Message Type 是正确的,并且我的 Construct Message 形状中有以下代码。

strCellNos = classHelper.getElement(SendSMStoCustomerRequest, "cell_number");
strSMS = classHelper.getElement(SendSMStoCustomerRequest, "message");
msg_SendSMStoCustomer.parameter = strSMS;
msg_SendSMStoCustomer(SMTP.Subject) = "Test Message for " + strCellNos ;
msg_SendSMStoCustomer(SMTP.From) = "noreply@none.com";
msg_SendSMStoCustomer(SMTP.SMTPHost) = "SMTPHOST";
msg_SendSMStoCustomer(SMTP.EmailBodyText) = strSMS ;
msg_SendSMStoCustomer(SMTP.EmailBodyTextCharset)="UTF-8";
msg_SendSMStoCustomer(SMTP.SMTPAuthenticate) = 0;

您可以在这里查看类似的问题:

基本上,如果您将 System.String 变量分配给消息,BizTalk 会将 string 节点包裹起来。

链接问题中的建议答案提供了一个可以绕过此问题的辅助方法。

我将在此处重复我在 MSDN 中的回答。

只需使用平面文件架构和管道中的平面文件汇编器将传出消息视为平面文件。

相信我,这非常非常容易。您正在尝试的所有这些事情都是为了解决您根本不应该遇到的问题。

请退后一步,在开始时将 msg_SendSMStoCustomer 创建为平面文件类型。然后,它就会起作用,我向你保证。