tag:blogger.com,1999:blog-9104813501868351989.post3000245608381768117..comments2024-02-25T02:18:41.249-08:00Comments on DUSHAN 'S VIEW: Adding Root Element for Aggregate Response (Alternative)DUSHAN TECH VISIONhttp://www.blogger.com/profile/01549659515037283808noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-9104813501868351989.post-49534177504662150452013-06-29T08:56:10.754-07:002013-06-29T08:56:10.754-07:00Following is an alternative way of doing this.
&l...Following is an alternative way of doing this.<br /><br /><aggregate><br /> <completeCondition><br /> <messageCount min="-1" max="-1"/><br /> </completeCondition><br /> <onComplete xmlns:ns="http://org.apache.synapse/xsd"<br /> xmlns:sb="http://ws.starbucks.com"<br /> expression="//sb:addOrderResponse"><br /> <property name="BODY" expression="$body/child::*"/><br /> <payloadFactory><br /> <format><br /> <rootElement>$1</rootElement><br /> </format><br /> <args><br /> <arg expression="$ctx:BODY"/><br /> </args><br /> </payloadFactory><br /> </onComplete><br /></aggregate><br /><br /><br />In ESB 4.7.0, a new configuration option for aggregate mediator has introduced to acheive this.<br />You can define the root element in a property of type "OM" in the mediadation follow.<br /><br />To refer to it, we have a new configuration option in the aggregate mediator called "enclosingElementProperty".<br /><br /><br />New aggregate mediator configuration looks like follows.<br /><br /><aggregate><br /> <completeCondition><br /> <messageCount min="-1" max="-1"/><br /> </completeCondition><br /> <onComplete xmlns:ns="http://org.apache.synapse/xsd"<br /> xmlns:sb="http://ws.starbucks.com"<br /> expression="//sb:addOrderResponse" enclosingElementProperty="ENCLOSING_ELEMENT_PROPERTY_NAME_HERE"><br /> <br /> </onComplete><br /></aggregate><br /><br />Isuru Udanahttps://www.blogger.com/profile/18378348781470276621noreply@blogger.comtag:blogger.com,1999:blog-9104813501868351989.post-81068822707454028082013-06-17T23:43:35.771-07:002013-06-17T23:43:35.771-07:00Excellent blog Dushan! Just what I was looking for...Excellent blog Dushan! Just what I was looking for, keep up the great work!Anonymoushttps://www.blogger.com/profile/17966797312909886083noreply@blogger.com