Enterprise Integration Zone is brought to you in partnership with:

Madhuka is Software Engineer and currently works on the Jaggery, UES, WSO2 Gadget Server team. He holds a B.Sc (Hons) degree in Information Technology from the Faculty of Information Madhuka is a DZone MVB and is not an employee of DZone and has posted 36 posts at DZone. You can read more from them at their website. View Full User Profile

WSO2 ESB Payload Mediator Tutorial

05.17.2013
| 1125 views |
  • submit to reddit

This simple tutorial will lead you to write proxy with WSO2 ESB Payload Mediator.

Here is the client sending request payload for proxy

request:
<body>
   <p:getBusNo xmlns:p="http://transport.org">
      <xs:rootId>root1</xs:rootId>
   </p:getBusNo>
</body>

BackEnd service Request:
<body>
   <pos:getBusNo xmlns:p="http://pos.transport.org">
      <rooter:rootId>root1</rooter:rootId>
      <rooter:token>Aser4Tre321</rooter:token>
   </pos:getBusNo>
</body>

Proxy:

<payloadFactory>
  <format>
   <pos:getBusNo xmlns:pos="http://pos.transport.org">
      <rooter:rootId>$1</rooter:rootId>
      <rooter:token>MyToekn</rooter:token>
   </pos:getBusNo>
  </format>
<args>
    <arg  xmlns:p="http://transport.org" xmlns:xs="http://root.transport.org" expression="//p:getBusNo/xs:rootId"/>
</args>

</payloadFactory>

>

PUntitled

payload Factory will do the transformation.



Published at DZone with permission of Madhuka Udantha, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)