Hi Vivek,
You can use Iterate mediator with Aggregate mediator for your scenario as
in [1]. I have tried it with following synapse config in ESB.
<inSequence>
<iterate expression="//A/B">
<target>
<sequence>
<property name="BBBBBB" expression="//B" type="OM"/>
<filter source="get-property('BBBBBB')/linkId" regex="a">
<then>
<call>
<endpoint>
<address uri="
http://localhost:8280/services/testProxy"/>
</endpoint>
</call>
<property name="Val" expression="//Response/Link"/>
<enrich>
<source clone="true"
xpath="get-property('Val')"/>
<target xpath="get-property('BBBBBB')/testTag"/>
</enrich>
</then>
<else/>
</filter>
<enrich>
<source clone="true" xpath="get-property('BBBBBB')"/>
<target type="body"/>
</enrich>
<loopback/>
</sequence>
</target>
</iterate>
</inSequence>
<outSequence>
<property name="test" scope="default">
<A xmlns=""/>
</property>
<aggregate>
<completeCondition>
<messageCount min="-1" max="-1"/>
</completeCondition>
<onComplete expression="//B" enclosingElementProperty="test">
<send/>
</onComplete>
</aggregate>
</outSequence>
[1] https://docs.wso2.com/display/ESB500/Sample+400%3A+Message+
Splitting+and+Aggregating+the+Responses
Thanks
Sudharma
On Fri, Sep 15, 2017 at 12:09 PM, Malaka Silva <[email protected]> wrote:
> +Dev
> ---------- Forwarded message ----------
> From: Vivek Kumar <[email protected]>
> Date: Fri, Sep 15, 2017 at 10:47 AM
> Subject: Call Third party web service and Enriching the original message
> To: "[email protected]" <[email protected]>
>
>
> Hi Malaka,
>
> I have below requirement.I have generated below scenario:
>
> Original envelope(original.xml):
>
> <A>
>
> <B>
>
> <linkId>a</linkId>
>
> <testTag></testTag>
>
> </B>
>
> <B>
>
> <linkId>c</linkId>
>
> <testTag></testTag>
>
> </B>
>
> <B>
>
> <linkId>a</linkId>
>
> <testTag></testTag>
>
> </B>
>
> <B>
>
> <linkId>x</linkId>
>
> <testTag></testTag>
>
> </B>
>
> </A>
>
> When <linkId> contains value "a" like <linkId>a</linkId>
>
> We need to call another web service and get response
>
>
>
> Response is like below:
>
> <Response>
>
> <Link>someLink.com</Link>
>
> <Resp>test</Resp>
>
> <Resp>test</Resp>
>
> <Resp>test</Resp>
>
> <Resp>test</Resp>
>
> </Response>
>
> Then,
>
> Original envelope should to be enrtich as below using data <Link> tag of
> above response:
>
> <A>
>
> <B>
>
> <linkId>a</linkId>
>
> <testTag>someLink.com</testTag>
>
> </B>
>
> <B>
>
> <linkId>c</linkId>
>
> <testTag></testTag>
>
> </B>
>
> <B>
>
> <linkId>a</linkId>
>
> <testTag>someLink.com</testTag>
>
> </B>
>
> <B>
>
> <linkId>x</linkId>
>
> <testTag></testTag>
>
> </B>
>
> </A>
>
>
>
> Please help me how to achieve this in WSO2ESB.
>
>
>
>
>
>
>
> *Vivek Kumar*
>
> *Associate System Analyst*
>
> *Office: *+91-120-4737401 <+91%20120%20473%207401>
>
> *Mobile*: +91 8588897434 <+91%2085888%2097434>
>
> *Email*: [email protected] <[email protected]>
>
> *Skype:* vivekhereatskype
>
>
>
>
>
> Information contained in this e-mail and any attachments is confidential
> and intended for the use of the addressee only. Dissemination,
> distribution, copying or use of this communication without prior permission
> of the addressee is strictly prohibited. If you have received this
> transmission in error, please advise the originator by reply e-mail and
> delete it. Thank you. Salmon India’s Registered Address is: B-13, Sector
> 57, Noida (U.P.) 201301
> <https://maps.google.com/?q=B-13,+Sector+57,+Noida+(U.P.)+201301&entry=gmail&source=g>.
> Registered in India U72200DL2003PTC120356.
>
>
>
>
> Information contained in this e-mail and any attachments is confidential
> and intended for the use of the addressee only. Dissemination,
> distribution, copying or use of this communication without prior permission
> of the addressee is strictly prohibited. If you have received this
> transmission in error, please advise the originator by reply e-mail and
> delete it. Thank you. Salmon India’s Registered Address is: B-13, Sector
> 57, Noida (U.P.) 201301
> <https://maps.google.com/?q=B-13,+Sector+57,+Noida+(U.P.)+201301&entry=gmail&source=g>.
> Registered in India U72200DL2003PTC120356.
>
>
>
> --
>
> Best Regards,
>
> Malaka Silva
> Associate Director / Architect
> M: +94 777 219 791 <+94%2077%20721%209791>
> Tel : 94 11 214 5345
> Fax :94 11 2145300
> Skype : malaka.sampath.silva
> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
> Blog : http://mrmalakasilva.blogspot.com/
>
> WSO2, Inc.
> lean . enterprise . middleware
> https://wso2.com/signature
> http://www.wso2.com/about/team/malaka-silva/
> <http://wso2.com/about/team/malaka-silva/>
> https://store.wso2.com/store/
>
> Don't make Trees rare, we should keep them with care
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
--
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: [email protected] <[email protected]>
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev