Announcement Announcement Module
No announcement yet.
Annotated Web Service Using JDOM Marshaller/Unmarshaller Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Annotated Web Service Using JDOM Marshaller/Unmarshaller

    I'm writing a web service using version 1.5.5. My first attempt followed the tutorial approach and didn't use annotations. I wrote a class that implemented the Marshaller interface and used JDOM. I didn't write an Unmarshaller; I simply used XPath to pluck the two values I needed out of the incoming XML. Everything worked fine.

    Now I'm scaling up the complexity. I'd like to use annotations, because I want to have several methods in a service interface as endpoints.

    I've annotated my service implementation using the @Endpoing and @PayloadRoot annotations.

    All the docs and examples use JAXB, Castor, XmlBeans, etc. for OXM. My first thought was to just use the simple class I wrote that uses JDOM. I had it implement Unmarshaller and filled in the class. JUnit tests for it work fine.

    But the configuration for my non-standard OXM solution isn't clear. Can anyone tell me how to configure an annotated app with a non-standard JDOM OXM class?


  • #2
    In this case I would implement the Marshaller, Unmarshaller interfaces and add the GenericMarshallingMethodEndpointAdapter bean config

    <bean class="">
            <constructor-arg ref="marshaller"/>
    This has done the trick for me.