What Camel version do you use?

On Mon, Aug 5, 2013 at 5:48 PM, mikael_th <mikael.thor...@gmail.com> wrote:
> Hello,
>
> I am trying to unmarshall an XML string to a JAXB object, convert this to
> another JAXB object and then marshall this before I send it on a queue.
>
> The problem is that in the example below the unmarshall call is using the
> vgtInternalJaxb DataFormat and not the jaxb DataFormat which is sent to it.
>
> Is it not possible to have 2 JaxbDataFormats in the same route ?
>
> Thanks for any input
>
> // Mikael
>
> *Example code:*
>
> @Component
> public class GetStatusResponseLocalRoute extends SpringRouteBuilder {
>
>         @Override
>         public void configure() throws Exception {
>                 DataFormat vgtInternalJaxb = new
> JaxbDataFormat("com.company.site.vehicle.statusnot._1_0");
>                 DataFormat jaxb = new
> JaxbDataFormat("com.othercompany.vehicle.status._1_0");
>
>
>                 from("servlet:///vehicle_status_local")
>                 .setHeader("Accept", simple("text/xml"))
>                 .setHeader("Authorization", simple("username:passw"))
>                 .setHeader(Exchange.HTTP_URI,
> simple("http://localhost:8080/web/v1.0/vehicle/status/current/";))
>                 .to("https://www.company.com/site/test/";)
>                 .convertBodyTo(String.class)
>         .log("GetStatusResponseLocalRoute response: ${body}")
>                 .unmarshal(jaxb)
>                 .beanRef("vehicleStatusResponseHandler", "handleResponse")
>                 .convertBodyTo(VehicleStatusNotification.class)
>                 .marshal(vgtInternalJaxb)
>                 .convertBodyTo(String.class)
>         .log(">>> GetStatusResponseLocalRoute ${body}")
>         .to("wmq:MY.QUEUE");
>         }
> }
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/2-JaxbDataFormat-in-the-same-route-doesnt-work-tp5736799.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to