Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-266

AxiomContentHandler should empty the response body before adding the transformation result

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.3
    • Fix Version/s: 1.5 M2, 1.0.4
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Java 5 (build 1.5.0_13-b05-241) + Axiom 1.2.5

      Description

      AxiomContentHandler append the result of the XSLT transformation without first emptying the response body. The resulting SOAP response ends up with 2 body child elements : the original (untransformed) endpoint response and the transformation result.

      The following patch fixes the problem :

      — ../spring-ws-1.0.3/modules/core/src/main/java/org/springframework/ws/soap/axiom/AxiomContentHandler.java 2007-12-21 16:26:32.000000000 +0100
      +++ AxiomContentHandler.java 2008-01-08 15:14:41.000000000 +0100
      @@ -16,6 +16,7 @@

      package org.springframework.ws.soap.axiom;

      +import org.apache.axiom.om.OMNode;
      import org.apache.axiom.om.OMElement;
      import org.apache.axiom.om.impl.builder.SAXOMBuilder;
      import org.springframework.util.Assert;
      @@ -39,6 +40,15 @@

      public void endDocument() throws SAXException {
      super.endDocument();
      +
      + // Remove original (i.e. source) response body.
      + OMNode child = null;
      + while ((child = parentElement.getFirstOMChild()) != null)
      +

      { + child.detach(); + }

      +
      + // Set result (i.e. transformed) response body.
      parentElement.addChild(super.getRootElement());
      }
      }

        Attachments

          Activity

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              lbihanic Laurent Bihanic
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: