for (int i = 0; i < reader.getNamespaceCount(); i++) {
headerBlockNamespaces.put(reader.getNamespacePrefix(i), reader.getNamespaceURI(i));
}
}
// Mark
XMLStreamBuffer mark = new XMLStreamBufferMark(headerBlockNamespaces, creator);
handleSecurityHeader();
} else {
try {
// Collect namespaces on SOAP header block
if (reader.getNamespaceCount() > 0) {
headerBlockNamespaces = new HashMap<String, String>(namespaces);
for (int i = 0; i < reader.getNamespaceCount(); i++) {
headerBlockNamespaces.put(reader.getNamespacePrefix(i), reader.getNamespaceURI(i));
}
}
// Mark
XMLStreamBuffer mark = new XMLStreamBufferMark(headerBlockNamespaces, creator);
GenericSecuredHeader gsh = new GenericSecuredHeader(reader, soapVersion, creator, (HashMap) namespaces, staxIF, context.getEncHeaderContent());
headers.add(gsh);
} catch (XMLStreamBufferException ex) {
throw new XWSSecurityException("Error occurred while reading SOAP Header" + ex);