Uploaded image for project: 'ServiceMix'
  1. ServiceMix
  2. SM-722

ExtendedXMLStreamReader strips whitespaces, which breaks servicemix-http when a SOAP invocation contains whitespace nodes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0
    • 3.0.1, 3.1
    • servicemix-core
    • None

    Description

      The problem is in the code below in ExtendedXMLStreamReader, which is used by SoapMarshaler to extract the SOAP message from a http invocation, and put it in a NormalizedMessage.
      I have a SOAP message that has things like this: <text> </text>. The whitespace is significant, and should not be trimmed, yet the message comes out as <text/>.

      Is there a reason for explicitely doing this?

      public int nextTag() throws XMLStreamException {
      int eventType = next();
      while((eventType == XMLStreamConstants.CHARACTERS && isWhiteSpace()) // skip whitespace

      (eventType == XMLStreamConstants.CDATA && isWhiteSpace())
      // skip whitespace
      eventType == XMLStreamConstants.SPACE
      eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
      eventType == XMLStreamConstants.COMMENT
      ) { eventType = next(); }

      if (eventType != XMLStreamConstants.START_ELEMENT && eventType != XMLStreamConstants.END_ELEMENT)

      { throw new XMLStreamException("expected start or end tag", getLocation()); }

      return eventType;
      }

      Attachments

        Activity

          People

            gnodet Guillaume Nodet
            bruyeron@fullsix.com Renaud Bruyeron
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: