* @throws IOException
* @throws WsException
*/
private void readSoapHeaders(IXMLReader xmlReader, InContext context) throws IOException, WsException {
try {
XmlReaderWrapper wrpr = XmlReaderWrapper.createXmlReaderWrapper(xmlReader);
while (wrpr.toTag() == IXMLReader.START_TAG) {
/**
* If handlers are defined on the headers, they have the opportunity to read the header. Otherwise the
* header will be skipped.
*/
Object header = context.invokeInHandlers(SoapPhase.HEADER, xmlReader);
if (header == null) {
String mustUnderstand = xmlReader.getAttributeValue(SoapConstants.SOAP_URI,
SoapConstants.MUSTUNDERSTAND_NAME);
if (SoapConstants.MUSTUNDERSTAND_TRUE.equals(mustUnderstand)) {
throw new WsNotUnderstoodException("");
}
wrpr.skipPastEndTag(xmlReader.getNamespace(), xmlReader.getName());
}
}
} catch (JiBXException e) {
throw new WsException("Error while unmarshalling SOAP header details", e);
}