camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamalissimo <>
Subject camel-xmljson convert POJO to XML
Date Mon, 13 Jan 2014 09:29:42 GMT
Hello guys, 

I need to cenvert POJO or JSON to XML file. I was sort of able to generate
XML with Jackson library, but I would like to use camel-xmljson and I don't
know how exactly. I read the documentation at and I know how to set it up and how to
marshal it, but the main thing I have to do is to set vaiable *enabled* as
an attribute of *username* and I have no idea how.

Here is my POJO TestUser

    public class TestUser extends JsonType
        private final String username;
        private final String fullname;
        private final String email;
        private final Boolean enabled;
        public TestUser(
            @JsonProperty("username") String username, 
            @JsonProperty("fullname") String fullname, 
            @JsonProperty("email") String email,
            @JsonProperty("enabled") Boolean enabled)
                this.username = username;
                this.fullname = fullname;
       = email;
                this.enabled = enabled;
            public String getUsername()
                return username;
            public String getFullname()
                return fullname;
            public String getEmail()
                return email;
            public Boolean getEnabled()
                return enabled;

and I need to create this XML:

    <TestUser xmlns:xsi=""
            <username enabled="true">FOO</username>
            <fullname>FOO BAR</fullname>

Any help will be appreciated


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

View raw message