3 Replies Latest reply on Jun 28, 2011 11:07 PM by Willem Jiang

    Configuring the Jaxb marshaller?

    jamie archibald Apprentice

      I have a route that uses the Jaxb marshaller:

       

       

      String pkg = ObjectFactory.class.getPackage().getName();

                JaxbDataFormat jaxb = new JaxbDataFormat(pkg);

                jaxb.setPrettyPrint(true);

                jaxb.setPartClass(MyClass.class.getName());

                jaxb.setPartNamespace(new QName(

                          "http://mynamespace/namespace","",""));

                jaxb.setEncoding("UTF-8");

       

      from("activemq:someQueue")

      .unmarshal(jaxb)

      .process( // do something )

      .marshal(jaxb)

      .to("activemq:anotherQueue");

       

       

      I want to know how I can configure the marshaller such that it won't output the xml declaration and also namespaces.