Announcement Announcement Module
Collapse
No announcement yet.
Annotated Web Service Using JDOM Marshaller/Unmarshaller Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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

    Code:
    <bean class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter">
            <constructor-arg ref="marshaller"/>
        </bean>
    This has done the trick for me.

    Comment

    Working...
    X