[SWS-455] Mangled predefined xml 'special character' entities when using AxiomSoapMessageFactory and extending AbstractStaxStreamPayloadEndpoint Created: 01/Dec/08  Updated: 04/May/12  Resolved: 12/Dec/08

Status: Closed
Project: Spring Web Services
Component/s: Core
Affects Version/s: 1.5.5
Fix Version/s: 1.5.6

Type: Bug Priority: Critical
Reporter: Paul Dotsenko Assignee: Arjen Poutsma
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sun jdk 1.5, Spring-ws 1.5.5, Spring 2.5.6, Tomcat 6, AxiomSoapMessageFactory, endpoint extends AbstractStaxStreamPayloadEndpoint

Issue Links:
duplicates SWS-434 JibxMarshaller - marshalSaxHandlers Closed


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; }



Comment by Arjen Poutsma [ 04/May/12 ]

Closing old issues

Generated at Tue Oct 23 09:24:06 UTC 2018 using JIRA 7.9.2#79002-sha1:3bb15b68ecd99a30eb364c4c1a393359bcad6278.