-
Notifications
You must be signed in to change notification settings - Fork 317
Description
Paul Dotsenko opened SWS-455 and commented
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;
}
...
}
Affects: 1.5.5
Issue Links:
- SWS-434 JibxMarshaller - marshalSaxHandlers
("duplicates")
1 votes, 2 watchers