Biztalk マップでは、ソース スキーマに文字列があり、宛先スキーマは文字列の配列を待機しています。
文字列が 1 つだけの文字列配列を作成する必要があるだけですが、作成できません。
スクリプト 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、メッセージ、電話番号)のリストです。オーケストレーションのループを使用して、すべての SMS を繰り返し処理し、SMSSend メッセージを準備します。このマッピングは、リスト内の SMS ごとに発生します (そのため、カウンターがあります)。
電話番号は、私が問題を抱えている文字列です
<xs:schema xmlns:tns="http://schemas.datacontract.org/2004/07/ADOSybaseWCFServices" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/ADOSybaseWCFServices" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="SMSBatch">
<xs:sequence>
<xs:element name="IDBatch" type="xs:int" />
<xs:element name="SMSList" nillable="true" type="tns:ArrayOfSMS" />
</xs:sequence>
</xs:complexType>
<xs:element name="SMSBatch" nillable="true" type="tns:SMSBatch" />
<xs:complexType name="ArrayOfSMS">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="SMS" nillable="true" type="tns:SMS" />
</xs:sequence>
</xs:complexType>
<xs:element name="ArrayOfSMS" nillable="true" type="tns:ArrayOfSMS" />
<xs:complexType name="SMS">
<xs:sequence>
<xs:element name="ID" type="xs:int" />
<xs:element name="Message" nillable="true" type="xs:string" />
<xs:element name="PhoneNumber" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="SMS" nillable="true" type="tns: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 は、メッセージごとに 1 人の受信者しかいないため、phonenumber 文字列から作成する文字列配列です。
...
<xml>
<complexType name="ArrayOf_soapenc_string">
<complexContent mixed="false">
<restriction xmlns:q1="http://schemas.xmlsoap.org/soap/encoding/" base="q1:Array">
<attribute xmlns:d5p1="http://schemas.xmlsoap.org/wsdl/" d5p1:arrayType="q1:string[]" ref="q1:arrayType" />
</restriction>
</complexContent>
</complexType>
<complexType name="Submission" abstract="true">
<sequence>
<element xmlns:q2="http://mobicomp.com/smsexpress/webservice/server/message" name="contactLists" nillable="true" type="q2:ArrayOf_soapenc_string" />
<element name="deliveryDate" nillable="true" type="dateTime" />
<element name="notification" type="boolean" />
<element xmlns:q3="http://schemas.xmlsoap.org/soap/encoding/" name="notificationRecipient" nillable="true" type="q3:string" />
<element xmlns:q4="http://schemas.xmlsoap.org/soap/encoding/" name="notificationType" nillable="true" type="q4:string" />
<element xmlns:q5="http://mobicomp.com/smsexpress/webservice/server/message" name="recipients" nillable="true" type="q5:ArrayOf_soapenc_string" />
<element xmlns:q6="http://schemas.xmlsoap.org/soap/encoding/" name="sender" nillable="true" type="q6:string" />
<element name="validity" type="int" />
</sequence>
</complexType>
</xml>
...
解決済み:
インライン XSLT テンプレートで Functoid のスクリプトを使用しました
<xsl:template name="recipients">
<xsl:param name="phone" />
<recipients>
<recipient><xsl:value-of select="$phone" /></recipient>
</recipients>