[ 
https://issues.apache.org/activemq/browse/SM-1144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Guillaume Nodet updated SM-1144:
--------------------------------

    Fix Version/s: servicemix-shared-2008.01

> Error in writeDetails method when I need return fault messages
> --------------------------------------------------------------
>
>                 Key: SM-1144
>                 URL: https://issues.apache.org/activemq/browse/SM-1144
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-soap
>    Affects Versions: 3.1.2
>         Environment: Servicemix 3.1.2
>            Reporter: Jorge Rodríguez Pedrianes
>            Assignee: Guillaume Nodet
>            Priority: Critical
>             Fix For: 3.2.1, 3.3, servicemix-shared-2008.01
>
>
> 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:
> {code:title=SoapWriter.java|borderStyle=solid}
>    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);
>         }
>     }
> {code}
> The correct code are:
> {code:title=SoapWriter.java|borderStyle=solid}
>    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);
>         }
>     }
> {code}
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to