1 Reply Latest reply on Jun 20, 2012 5:50 AM by Keith Babo

    Automatically Detected JAXB Transformations

    Erhard Siegl Novice

      In https://docs.jboss.org/author/display/SWITCHYARD/Transformation there is mentioned that there is no need to register transformations when JAXB-types are used. I tried this, but couldn't get it working (in Unit-Test). It works, when I register the transformation in switchyard.xml. Is there a quickstart demonstrating this? The jaxb-quickstart also registers the transformation and the video linked from here seems to be gone.

      I packaged the JAXB-generated classes in a separate JAR? Could this be a probem?

       

      Registered transformation:

       

      {code}

          <transforms xmlns:xform="urn:switchyard-config:transform:1.0">

              <xform:transform.jaxb

                  from="java:at.bergfex.order._1.Order"

                  to="{http://bergfex.at/order/1.0}order"

                  contextPath="at.bergfex.order._1"/>

              <xform:transform.jaxb

                  from="{http://bergfex.at/order/1.0}order"

                  to="java:at.bergfex.order._1.Order"

                  contextPath="at.bergfex.order._1"/>

          </transforms>

       

      {code}

       

       

      Service:

       

      {code}

      import org.switchyard.component.bean.Service;

      import at.bergfex.order._1.Order;

       

      @Service(Ordering.class)

      public class OrderingBean implements at.objectbay.tests.Ordering {

       

          @Override

          public int process(Order order) {

           ...

          }

      }

      {code}

       

        • 1. Re: Automatically Detected JAXB Transformations
          Keith Babo Master

          This is in flux at the moment.  I made some changes as part of SWITCHYARD-828 that improve JAXB handling overall (e.g. ObjectFactory is not required), but had a side effect of disabling runtime auto-registration.  It's better to generate the config vs. registering these at runtime, so I created SWITCHYARD-831 as a separate issue to handle that.

           

          hth,

          keith