camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vanshul.Chawla <>
Subject RE: Camel XmlJson Question
Date Wed, 29 Jul 2015 03:29:06 GMT

This gives examples also. You just need to set dataFormat and use a process ref for xmljson.
It gives default element names. In case you need to change the element names, you need to
use expended properties.

import org.json.JSONException;
import org.json.JSONObject;
import org.json.XML;

public class JsontoXML {

   * @param args
   * @throws JSONException 
  public static void main(String[] args) throws JSONException {
    String jsonStr = "";
    JSONObject jsonObj = new JSONObject(jsonStr);


This java code also converts json to xml.
String jsonStr="" needs to be changed to read from input exchange.

Thanks and Regards,

Vanshul Chawla

-----Original Message-----
From: srinit [] 
Sent: Tuesday, July 28, 2015 8:22 PM
Subject: Camel XmlJson Question

Hi Folks,

I am very new to Camel library and getting confused whether I am in right place for my requirement
or not?

Here is my requirement, I need conversion from xml to json and viceversa in java project.
Basically I need to convert a Xml SOAP message to Json and from json to SOAP Xml message with
namespaces and other informations from SOAP message.

I feel Camel XmlJson can help to do this. But neither I did find any simple example to understand
xmlJson module nor good documentation to understand functionality of Camel xmlJson.

Can some one point me any resources to understand the xmlJson of Camel?


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message