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

Mangled predefined xml 'special character' entities when using AxiomSoapMessageFactory and extending AbstractStaxStreamPayloadEndpoint


    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: 1.5.5
    • Fix Version/s: 1.5.6
    • Component/s: Core
    • Labels:
    • Environment:
      Sun jdk 1.5, Spring-ws 1.5.5, Spring 2.5.6, Tomcat 6, AxiomSoapMessageFactory, endpoint extends AbstractStaxStreamPayloadEndpoint


      Using AxiomSoapMessageFactory and with an endpoint extending AbstractStaxStreamPayloadEndpoint, special character predefined entities like & or < in HTTP response get 'mangled'. For example, when the endpoint writes <echo:echoRequest> < </echo:echoRequest> to the XMLStreamWriter (which is correct) what actually gets sent in the resulting AxiomSoapMessage is this: <echo:echoRequest> &<; </echo:echoRequest> (which is incorrect). I recreated this bug with the echo sample application in 1.5.5 by changing the endpoint to extend AbstractStaxStreamPayloadEndpoint and specifying the AxiomSoapMessageFactory in the spring-ws-servlet.xml file (documented in this forum thread: http://forum.springframework.org/showthread.php?p=215668)

      I was able to correct this behavior by modifying org.springframework.ws.soap.axiom.AxiomHandler - I simply commented out the statements inside startEntity(..) and endEntity(..) functions making them "unsupported". While this did not produce any side-effects during the testing I did for my project, I have not run the full spring-ws test suite. The change is as follows:

      class AxiomHandler implements ContentHandler, LexicalHandler {


      public void startEntity(String name) throws SAXException

      { //make unsupported to fix mangling of special character entities //charactersType = XMLStreamConstants.ENTITY_REFERENCE; }

      public void endEntity(String name) throws SAXException

      { //make unsupported to fix mangling of special character entities //charactersType = XMLStreamConstants.CHARACTERS; }




          Issue Links



              • Assignee:
                arjen.poutsma Arjen Poutsma
                pdotsenko Paul Dotsenko
              • Votes:
                1 Vote for this issue
                2 Start watching this issue


                • Created: