Over a million developers have joined DZone.
Gold Partner

WSO2 ESB Payload Mediator Tutorial

· Integration Zone

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.



Topics:

Published at DZone with permission of Madhuka Udantha , DZone MVB .

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}