final String role = streamReader.getAttributeValue(soapDetails.getNamespaceURI(), soapDetails.getRoleLocalName()) ;
if ((role == null) || role.equals(soapDetails.getLastRole()) ||
role.equals(soapDetails.getNextRole()))
{
final QName headerName = streamReader.getName() ;
final HeaderHandler headerHandler = soapService.getHeaderHandler(headerName) ;
if (headerHandler == null)
{
checkMustUnderstand(streamReader, soapDetails) ;
ElementConsumer.consume(streamReader) ;
}
else
{
headerHandler.invoke(streamReader, messageContext) ;
handlers.add(headerHandler) ;
}
streamReader.require(XMLStreamConstants.END_ELEMENT,
headerName.getNamespaceURI(), headerName.getLocalPart()) ;
}
else
{
ElementConsumer.consume(streamReader) ;
}
}
}
while(!finished) ;
final Map headerHandlers = soapService.getHeaderHandlers() ;
final Iterator headerHandlerIter = headerHandlers.values().iterator() ;
while(headerHandlerIter.hasNext())
{
final HeaderHandler handler = (HeaderHandler)headerHandlerIter.next() ;
handler.headerValidate(messageContext) ;
}
}
catch (final Throwable th)
{
final int numHandlers = handlers.size() ;
if (numHandlers > 0)
{
final ListIterator listIterator = handlers.listIterator(numHandlers) ;
do
{
final HeaderHandler headerHandler = (HeaderHandler)listIterator.previous() ;
headerHandler.headerFaultNotification(messageContext) ;
}
while(listIterator.hasPrevious()) ;
}
if (th instanceof XMLStreamException)