Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
None
-
None
-
Servicemix 3.1.2
Description
Hi!
Today I chage version of servicemix 3.1-incubating to 3.1.2. But now I don't return in my service fault message.
I see in SoapWriter class in writeDetails method that:
SoapWriter.java
private void writeDetails(XMLStreamWriter writer, Source details) throws ParserConfigurationException, IOException, SAXException, TransformerException, XMLStreamException { SourceTransformer st = new SourceTransformer(); DOMSource domDetails = st.toDOMSource(details); Node detailsNode = domDetails.getNode().getFirstChild(); if ( SoapMarshaler.MULTIPLE_DETAILS_NODE_WRAPPER.equals(detailsNode.getNodeName()) ) { NodeList children = detailsNode.getChildNodes(); for ( int i = 0; i < children.getLength(); i++ ) { Node node = children.item(i); if ( node.getNodeType() == Node.ELEMENT_NODE ) { XMLStreamReader reader = marshaler.getSourceTransformer().toXMLStreamReader(new DOMSource(node)); XMLStreamHelper.copy(reader, writer); } } } else { XMLStreamReader reader = marshaler.getSourceTransformer().toXMLStreamReader(details); // ERROR XMLStreamHelper.copy(reader, writer); } }
The correct code are:
SoapWriter.java
private void writeDetails(XMLStreamWriter writer, Source details) throws ParserConfigurationException, IOException, SAXException, TransformerException, XMLStreamException { SourceTransformer st = new SourceTransformer(); DOMSource domDetails = st.toDOMSource(details); Node detailsNode = domDetails.getNode().getFirstChild(); if ( SoapMarshaler.MULTIPLE_DETAILS_NODE_WRAPPER.equals(detailsNode.getNodeName()) ) { NodeList children = detailsNode.getChildNodes(); for ( int i = 0; i < children.getLength(); i++ ) { Node node = children.item(i); if ( node.getNodeType() == Node.ELEMENT_NODE ) { XMLStreamReader reader = marshaler.getSourceTransformer().toXMLStreamReader(new DOMSource(node)); XMLStreamHelper.copy(reader, writer); } } } else { XMLStreamReader reader = marshaler.getSourceTransformer().toXMLStreamReader(domDetails); // OK XMLStreamHelper.copy(reader, writer); } }
Because if details param is a StreamSource when I do "st.toDOMSource(details);" I read the stream and when I create XMLStreamReader this Stream its empty
Thanks