// Move to next element
XMLStreamReaderUtil.nextElementContent(reader);
XMLStreamReaderUtil.verifyReaderState(reader,
javax.xml.stream.XMLStreamConstants.START_ELEMENT);
HeaderList headers = null;
TagInfoset headerTag = null;
if (reader.getLocalName().equals(SOAP_HEADER)
&& reader.getNamespaceURI().equals(soapVersion.nsUri)) {
headerTag = new TagInfoset(reader);
// Collect namespaces on soap:Header
for(int i=0; i< reader.getNamespaceCount();i++){
namespaces.put(reader.getNamespacePrefix(i), reader.getNamespaceURI(i));
}
// skip <soap:Header>
XMLStreamReaderUtil.nextElementContent(reader);
// If SOAP header blocks are present (i.e. not <soap:Header/>)
if (reader.getEventType() == XMLStreamConstants.START_ELEMENT) {
headers = new HeaderList(soapVersion);
try {
// Cache SOAP header blocks
StreamHeaderDecoder headerDecoder = SOAPVersion.SOAP_11.equals(soapVersion) ? SOAP11StreamHeaderDecoder : SOAP12StreamHeaderDecoder;
cacheHeaders(reader, namespaces, headers, headerDecoder);