Mapping Biztalk映射,从字符串创建字符串[]

Mapping Biztalk映射,从字符串创建字符串[],mapping,biztalk,biztalk-2009,Mapping,Biztalk,Biztalk 2009,在biztalk映射中,源架构具有字符串,而目标架构正在等待字符串数组 我只需要用一个字符串创建一个字符串数组,但我做不到 我尝试使用脚本functoid和一些内联C: public Array ArrayBuilder(string param1) { ArrayList result = new ArrayList(); result.Add(param1); return result.ToArray(typeof( string )); } 但functoid输

在biztalk映射中,源架构具有字符串,而目标架构正在等待字符串数组

我只需要用一个字符串创建一个字符串数组,但我做不到

我尝试使用脚本functoid和一些内联C:

public Array ArrayBuilder(string param1)
{
    ArrayList result = new ArrayList();
    result.Add(param1);
    return result.ToArray(typeof( string ));
}
但functoid输出的不是数组,而是:

...
<recipients>System.String[]</recipients>
...
有什么帮助吗

谢谢

编辑

源模式

基本上是SMS Id、消息和电话号码的列表。通过orchrestation中的一个循环,我遍历所有SMS并准备一条SMSSend消息。此映射将针对列表中的每个SMS发生,这就是为什么我有一个计数器

电话号码是我遇到问题的字符串

柜台:

<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://SendSMS.counterSchema" targetNamespace="http://SendSMS.counterSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element default="0" name="counter" type="xs:int" /> 
目标模式

为了您的理智,我不会把整个模式放在这里,它是从WCF服务自动生成的

Recipients是我想从phonenumber字符串创建的字符串数组,因为我每封邮件只有一个收件人

已解决:

我使用内联XSLT模板创建和编写functoid脚本

<xsl:template name="recipients">
<xsl:param name="phone" />

<recipients>
    <recipient><xsl:value-of select="$phone" /></recipient>
</recipients>

好的,根据您实际应该发送到目的地地图的内容,我可能会这样做:

假设您收到一个字符串flibberdyjibit并希望将其作为字符串[]中的唯一项,我会这样做:

如果您接收到某种分隔字符串,需要将其转换为数组,我将假设您会执行以下操作:

public string[] ReturnStringArray(string input)
{
    return input.split('|');
}

注意:我没有编译其中任何一个,可能会有语法错误,但如果有,intellisense应该可以帮助您解决问题。

我建议您考虑使用XSLT模板来处理方法提取的单个字符串值

因此,创建数组,并为每个字符串生成目标Xml

看一看关于在地图中使用XSLT模板的内容

如果没有目标模式,这就是我目前所能建议的。
HTH

您也可以发布模式吗?特别是目标架构。难道不能将字符串映射到目标元素吗?谢谢,但结果是一样的:System.string[]而不是字符串数组本身根据更新的注释,是否应该用某种子节点的数组填充父节点?那么Jonesmith?是的。我有一个字符串+33344434,它必须是:+3344434,但我只能得到+3344434。我知道我可以制作一个XSLT,从66666创建66666。如何表示多个?这不会发生,我每个收件人有一条消息,1-1关系,模式是从多个收件人的一条消息准备的,1-N,但是我的是个性化的啊,我明白了!我仍然建议您使用XSLT模板将源代码转换成目标表单。如果生成目标实例以获取结构,则可以使用源代码和XSLT的输入重新创建该结构。这是我要走的路。。。
<xsl:template name="recipients">
<xsl:param name="phone" />

<recipients>
    <recipient><xsl:value-of select="$phone" /></recipient>
</recipients>
public string[] ReturnStringArray(string input)
{
    string[] output = new string[] { input };
    return output;
}
public string[] ReturnStringArray(string input)
{
    return input.split('|');
}