Over a million developers have joined DZone.

WSO2 ESB Payload Mediator Tutorial

· Integration Zone

Visually compose APIs with easy-to-use tooling. Learn how IBM API Connect provides near-universal access to data and services both on-premises and in the cloud, brought to you in partnership with IBM.

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.



Visually compose APIs with easy-to-use tooling. Learn how IBM API Connect provides near-universal access to data and services both on-premises and in the cloud, brought to you in partnership with IBM.

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 }}