[Blog Post] How to Aggregate Responses of Two REST Endpoints and Convert to JSON Using WSO2 ESB

  • By Lahiru Gamage
  • 1 Oct, 2014

Here is a use case I came across recently. In this use case, it will receive responses from two endpoints which are rest, aggregate them as a single body, which is XML, and convert it to JSON before sending a response.

Highlights

  • Using clone mediator for cloning the message body and send it to two endpoints
  • Using aggregate mediator for aggregating the response from two endpoints
    • Enclosing the response using custom tag
  • Converting the XML response to JSON property mediator(messageType)

Proxy

  

Click here to refer to Lahiru's blog.