Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following example uses a named DataFormat of soap which is configured with the package com.example.customerservice to initialize the JAXBContext. The second parameter is the ElementNameStrategy. The route is able to marshal normal objects as well as exceptions. (Note that no actual SOAP call is being made here, just the SOAP Envelope in XML format is being sent to a queue.this route defines a one way soap request. If you need request reply then you should look at the next example)

Code Block
SoapJaxbDataFormat soap = new SoapJaxbDataFormat("com.example.customerservice", new ServiceInterfaceStrategy(CustomerService.class));
from("direct:start")
  .marshal(soap)
  .to("jms:myQueue");

...