9 Replies Latest reply on Jul 10, 2013 7:15 PM by Keith Babo

    jaxb transformation in a camel route

    Jeff Bride Novice


        This post is in reference to my SY app  with a couple of java bean components (BeanOne and BeanTwo) that could either be invoked directly from a corresponding SOAP service gw or via a camel route component (CamelChoice).

         Appropriate JAXB transformations are in place and do get invoked just fine if the originating SOAP call is to either IBeanOne or IBeanTwo SOAP service gateways.


        when the originating SOAP call is to IBeanCombo, the CamelChoice camel component does route appropriately.

        However, it invokes the java bean components with a null message body.

        This behavior is due to line 66 of CamelMessageComposer.java in the SY master branch.

         The logic in the composer assumes that if the target URI is a java bean component, the message body will also already be a java object.

         explicity executing SOAP-->java tranformations as part of the camel route solves the problem.


        couple of questions/observations :


      1)  SY does a nice job of implicitly invoking needed transformations  when the SOAP call originates from either my IBeanOne or IBeanTwo SOAP service gateways.

            of course i got greedy and assumed this special sauce would be applied for me anywhere I would need it :-)  .... to include somewhere between my camel route component and my target java bean component.

            so the null message body threw me for a loop until I reviewed the CamelMessageComposer code.

            I'm fine with explicitly handling the message transformations in the camel route.

            it may be helpful however to post a nice WARN log message explaining the cause/rationale of the null message body



      2)  what's the recommended approach to explicitly invoke a transformation from a camel route ??

           keith:  you already recommended use of the Camel jaxb marshaller .... and yes, that does work well  ( i had to add the camel-jaxb.jar as a jboss module and add that module as a dependency in my SY app )

            however, my SY app already defines JAXB transformations.   Is introducing the camel-jaxb.jar library the only option to explict do a jaxb transform in my camel route ?

           Is there a way that existing SY java and jaxb transformers can be referenced in a camel route via their URI  ?

            ie:  the URI to an xslt transform would be:    <to  uri="xslt:path/to/my/xslt" /> .     what is the equivalent uri  to my existing jaxb and java transformers  ?



      thank you!   jeff