CheckFaultInterceptor causes XMLStreamReader to throw IllegalState at doc end
-----------------------------------------------------------------------------

                 Key: CXF-1657
                 URL: https://issues.apache.org/jira/browse/CXF-1657
             Project: CXF
          Issue Type: Bug
          Components: Soap Binding
    Affects Versions: 2.1
            Reporter: Jayson Raymond


>From handleMessage():
  :
        try {
            // advance to first tag.
            int x = xmlReader.getEventType();
            while (x != XMLStreamReader.START_ELEMENT
                && x != XMLStreamReader.END_ELEMENT
                && xmlReader.hasNext()) {
                x = xmlReader.next();
            }
        } catch (XMLStreamException e) {
            throw new SoapFault(new Message("XML_STREAM_EXC", LOG), e, 
                                message.getVersion().getSender());
        }
        if (message.getVersion().getFault().equals(xmlReader.getName())) {
 :
In the case where hasNext() == false (e.g. document end) will cause the 
subsequent call to xmlReader.getName() to throw an IllegalStateException, as 
per the javax.xml.stream,XMLStreamReader interface. It would seem the 
appropriate response would be to simply return in this case:

  :
        try {
            // advance to first tag.
            int x = xmlReader.getEventType();
            while (x != XMLStreamReader.START_ELEMENT
                && x != XMLStreamReader.END_ELEMENT
                && xmlReader.hasNext()) {
                x = xmlReader.next();
            }
            if ( x==XMLStreamReader.END_DOCUMENT) return;
        } catch (XMLStreamException e) {
 :


-- 
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