There are many ways of doing XML to JSON conversion, but they all produce different results. If you have to deliver the JSON in some particular externally-defined format, then it's very likely that none of the converters will produce exactly what you want, and you will need to do some coding (XSLT 3.0 is convenient for this). But if the requirement is "any old JSON" then any of the libraries will do.
Michael Kay > On 11 Feb 2020, at 19:05, Mark Lumsden <m...@hotmail.com> wrote: > > I am a newbie to Camel, Spring, Java (and everything about EIP!). I'm trying > to use Spring DSL to transform a REST GET request which provides XML data but > change it in to JSON for the client. Here is the abbreviated XML from the > Camel Context which just returns XML: > > [route id="api-route2"] > [from id="_route2" uri="direct:obj2"/] > [to id="_to2" > uri="http://localhost:8081/obj2/index.xml?bridgeEndpoint=true"/] > [/route] > > I get the XML document returned AOK from the local server via Camel, but is > it possible to change the format of the data just using Spring DSL in Camel? > I see quite a lot of examples on the web of using Java DSL to use marshaling > to do the translation. > > Any help much appreciated. > Mark