我希望在我的场景中在 WSO2ESB 中设置一个数组。
我将两个参数发送到数据库并获取行数,但我只需要一行。
我的配置是
<target>
<sequence>
<property name="partybranchid"
expression="get-property('partybranchid')"
scope="default"
type="STRING"/>
<payloadFactory>
<format>
<p:Select_MailDetails_Op xmlns:p="http://ws.wso2.org/dataservice">
<xs:assetid xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:assetid>
<xs:partybranchid xmlns:xs="http://ws.wso2.org/dataservice">$2</xs:partybranchid>
</p:Select_MailDetails_Op>
</format>
<args>
<arg expression="get-property('assetid')"/>
<arg expression="get-property('partybranchid')"/>
</args>
</payloadFactory>
<log level="full"/>
<send receive="Mail_Seq">
<endpoint>
<address uri="http://localhost:9764/services/massetparametersetdetail_DataService/"
format="soap11"/>
</endpoint>
</send>
</sequence>
</target>
我按以下顺序接收数据:
<log><property xmlns:v="http://ws.wso2.org/dataservice" xmlns:ns="http://org.apache.synapse/xsd"
name="primarymail" action="set"
expression="//v:primarymail/text()"
scope="default"
type="STRING"/></log>
<iterate xmlns:v="http://ws.wso2.org/dataservice"
xmlns:ns="http://org.apache.synapse/xsd"
id="Mail"
expression="//v:Datalist">
<target>
<sequence>
<property xmlns:v="http://ws.wso2.org/dataservice" xmlns:ns="http://org.apache.synapse/xsd"
name="primarymail"
expression="//v:primarymail/text()"
scope="default"
type="STRING"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="assetname"
expression="//assetname/text()"
scope="default"
type="STRING"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="assetcode"
expression="//assetcode/text()"
scope="default"
type="STRING"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="activityname"
expression="//activityname/text()"
scope="default"
type="STRING"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="username"
expression="//username/text()"
scope="default"
type="STRING"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="parametername"
expression="//parametername/text()"
scope="default"
type="STRING"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="uomcode"
expression="//uomcode/text()"
scope="default"
type="STRING"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="tododetails"
expression="fn:concat('AssetName:',get-property('assetname'),',','AssetCode:',get-property('assetcode'),',','ActivityName:',get-property('activityname'),',','UserName:',get-property('username'),',','ParameterName:',get-property('parametername'),',','UomCode:',get-property('uomcode'))"
scope="default"
type="STRING"/>
<log><property xmlns:v="http://ws.wso2.org/dataservice" xmlns:ns="http://org.apache.synapse/xsd"
name="primarymail" action="set"
expression="//v:primarymail/text()"
scope="default"
type="STRING"/></log>
</sequence>
</target>
</iterate>
</sequence>
我收到如下回复,但我只想发送一次邮件。
在这里我的邮件重复。我怎样才能取出这个邮件ID?
回复,primarymail = mail@myunisoft.commail@myunisoft.commail@myunisoft.commail@myunisoft.commail@myunisoft.commail@myunisoft.commail@myunisoft.commail@myunisoft.commail@myunisoft.commail@myunisoft.com
我怎样才能为此收取单封邮件?