5 Replies Latest reply on Nov 27, 2009 5:29 PM by Lyfe Musique

    Combining CXF responses

    Italo Giovani Stefani Newbie

      I have a scenario where I publish a webservice using CXF Endpoint.

      All requests that reach this endpoint is multicasted to a set of webservices with the same WSDL as the exposed one. Until now, everything is fine.

       

      But, I need to aggregate the webservices responses. I have tried to get the out body as exchange.getOut().getBody(), but it does not contains the response. I found the espected resopnse inside the CxfMessage, but I could not create the aggregated messages.

       

      Let say I have 3 webservices with the following responses:

       

      1)

       

       

       

      So, the first caller will see only one response containing all responses together.

       

      My route is something like this:

       

           from("cxf:bean:ridProfile")

              .multicast(new RidSourceAggregator(), true)

              .to("cxf:bean:ridWs01","cxf:bean:ridWs02","cxf:bean:ridWs03");

       

       

      How can I buid the aggregated response? Nothing as

           CxfMessage cxfMessage = (CxfMessage) exchange.getOut();

           cxfMessage.getMessage().getContent(...)

           cxfMessage.getMessage().getContentFormats()

       

      seems to work for me.

       

       

      Regards.

       

      Italo Stefani

      Vetta Technologies

      www.vettatech.com