Iterator<?> attibutesIterator = soapHeader.getAllAttributes();
while (attibutesIterator.hasNext()) {
QName name = (QName) attibutesIterator.next();
headers.put(name.toString(), soapHeader.getAttributeValue(name));
}
Iterator<?> elementIter = soapHeader.examineAllHeaderElements();
while (elementIter.hasNext()) {
Object element = elementIter.next();
if (element instanceof SoapHeaderElement) {
QName name = ((SoapHeaderElement) element).getName();
headers.put(name.toString(), element);