While Dispatch
objects are intended to be low level API that allows you to
work with raw messages, they also allow you to work with JAXB objects. To work with JAXB
objects a Dispatch
object must be passed a JAXBContext
that knows
how to marshal and unmarshal the JAXB objects in use. The JAXBContext
is passed
when the Dispatch
object is created.
You can pass any JAXB object understood by the JAXBContext
object as the
parameter to the invoke()
method. You can also cast the returned message into
any JAXB object understood by the JAXBContext
object.