You can enrich mediator to read the payload content very easily.
We will assume that ESB receives a payload as below.
<? xml version='1.0' encoding='utf -8'?> <soap : Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap: Body> <person> <name>tharanga wijeweer </name> </person> </soap: Body> </soap: Envelope>
Now, need to read this payload & set the name of the person to a property.
<enrich >
<source xmlns:soap="http://www.w3.org/2003/05/soap-envelope" clone="true" xpath ="//soap: Envelope/soap: Body/person/name/text( )"/>
<target type="property" property="PersonName"/>
</enrich>
Above enrich mediator reads the name of the person from the payload and set that value to the PersonName property.
Enjoy..!!
No comments:
Post a Comment