if (bodyPrologue != null) {
char[] chars = bodyPrologue.toCharArray();
contentHandler.characters(chars, 0, chars.length);
}
XMLStreamReaderToContentHandler conv = new XMLStreamReaderToContentHandler(reader,contentHandler,true,fragment,getInscopeNamespaces());
while(reader.getEventType() != XMLStreamConstants.END_DOCUMENT){
String name = reader.getLocalName();
String nsUri = reader.getNamespaceURI();
// After previous conv.bridge() call the cursor will be at END_ELEMENT.
// Check if its not soapenv:Body then move to next ELEMENT
if(reader.getEventType() == XMLStreamConstants.END_ELEMENT){
if (!isBodyElement(name, nsUri)){
// closing payload element: store epilogue for further signing, if applicable
// however if there more than one payloads exist - the last one is stored
String whiteSpaces = XMLStreamReaderUtil.nextWhiteSpaceContent(reader);
if (whiteSpaces != null) {
this.bodyEpilogue = whiteSpaces;
// write it to the message too
char[] chars = whiteSpaces.toCharArray();
contentHandler.characters(chars, 0, chars.length);
}
} else {
// body closed > exit
break;
}
} else {
// payload opening element: copy payload to writer
conv.bridge();
}
}
XMLStreamReaderUtil.readRest(reader);
XMLStreamReaderUtil.close(reader);
XMLStreamReaderFactory.recycle(reader);