ServiceMix Components
  1. ServiceMix Components
  2. SMXCOMP-224

Error in writeDetails method when I need return fault messages

    Details

      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

        Activity

        Jorge Rodríguez Pedrianes created issue -
        Guillaume Nodet made changes -
        Field Original Value New Value
        Resolution Fixed [ 1 ]
        Assignee Guillaume Nodet [ gnt ]
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 3.3 [ 11850 ]
        Guillaume Nodet made changes -
        Fix Version/s servicemix-shared-2008.01 [ 11933 ]
        Gert Vanthienen made changes -
        Project ServiceMix [ 10950 ] ServiceMix Components [ 11080 ]
        Fix Version/s servicemix-shared-2008.01 [ 11933 ]
        Fix Version/s 3.3 [ 11850 ]
        Fix Version/s servicemix-shared-2008.01 [ 12050 ]
        Fix Version/s 3.3 [ 12055 ]
        Component/s servicemix-soap [ 11810 ]
        Fix Version/s 3.2.1 [ 12057 ]
        Component/s servicemix-soap [ 11523 ]
        Key SM-1144 SMXCOMP-224
        Fix Version/s 3.2.1 [ 11847 ]
        Affects Version/s 3.1.2 [ 11824 ]
        Jeff Turner made changes -
        Project Import Sat Nov 27 01:42:42 EST 2010 [ 1290840162973 ]

          People

          • Assignee:
            Guillaume Nodet
            Reporter:
            Jorge Rodríguez Pedrianes
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development