Results 1 to 4 of 4

Thread: Using PayloadRoot Annotation and a DOM Endpoint

  1. #1

    Default Using PayloadRoot Annotation and a DOM Endpoint

    I'd like to use JDOM, and therefore the AbstractJDomPayloadEndpoint for my endpoint implementation. However, I'd also like to do configuration through annotations as much as possible. Therefore, I'd like to have some way to have endpoint mapping done with the @PayloadRoot annotation while still using the AbstractJDomPayloadEndpoint.

    Is there a way I'm missing to do this? Is there instead a different way I should easily integrate JDOM without inheriting from the abstract class?

  2. #2
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Yes, you can use JDOM via the javax.xml.transform.Source abstraction, so it takes a little more plumbing, but it will work. Just define a method like so:

    Code:
    public Source myEndointMethod(Source request) {
      Transformer transformer = TransformerFactory.newInstance().newTransformer();
      JDOMResult result = new JDOMResult();
      transformer.transform(request, result);
      Document document = result.getDocument();
      // use the JDOM document
    }
    and do the reverse for the response.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  3. #3

    Default

    Thanks. I did eventually look at the source for the AbstractJDomPayloadEndpoint and saw what it took, and did pretty much what you've suggested. Would it be a desirable for me to put in a JIRA request for DOM, JDOM, DOM4J and XOM type method signatures to be supported when using the @PayloadRoot annotation and have this be done automatically in a future version?

  4. #4

    Default

    I've logged my request here: http://jira.springframework.org/browse/SWS-349

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •