Ok i found a workaround for my problem...
From AbstractStaxStreamPayloadEndpoint:
Code:
private XMLStreamWriter getStreamWriter(Result result) {
XMLStreamWriter streamWriter = null;
if (result instanceof StaxResult) {
StaxResult staxResult = (StaxResult) result;
streamWriter = staxResult.getXMLStreamWriter();
}
if (streamWriter == null) {
try {
streamWriter = getOutputFactory().createXMLStreamWriter(result);
}
catch (XMLStreamException ex) {
// ignore
}
}
return streamWriter;
}
That's the catch block that silently swallows my XmlStreamException.
And the exception is the same as in my previous posting: <Can not create a STaX writer for a SAXResult -- not (yet) implemented.>
--> see http://forum.springframework.org/showthread.php?t=26392
To get writing with XmlStreamWriter working i changed the createStreamWriter method of the inner class
ResponseCreatingStreamWriter within AbstractStaxStreamPayloadEndpoint to:
Code:
private void createStreamWriter() throws XMLStreamException {
// as a final resort, use a stream, and transform that at
// endDocument()
os = new ByteArrayOutputStream();
streamWriter = getOutputFactory().createXMLStreamWriter(os);
}
}
and of course in the invokeInternal() of my endpoint class i added a writeEndDocument() at the end of reponse creation.
Now the response message is created properly. This is a workaround only,
to really fix it either the woodstox parser must implement Stax writing from SaxResult or the spring-ws code must be changed to return a StreamResult.