SOAPHeader header = doc.getSOAPHeader();
Collection<AssertionInfo> ais = aim.get(SP12Constants.REQUIRED_PARTS);
if (ais != null) {
for (AssertionInfo ai : ais) {
RequiredParts rp = (RequiredParts)ai.getAssertion();
ai.setAsserted(true);
for (Header h : rp.getHeaders()) {
if (header == null || DOMUtils.getFirstChildWithName(header, h.getQName()) == null) {
ai.setNotAsserted("No header element of name " + h.getQName() + " found.");
}
}
}
}
ais = aim.get(SP12Constants.REQUIRED_ELEMENTS);
if (ais != null) {
for (AssertionInfo ai : ais) {
RequiredElements rp = (RequiredElements)ai.getAssertion();
ai.setAsserted(true);
Map<String, String> namespaces = rp.getDeclaredNamespaces();
XPathFactory factory = XPathFactory.newInstance();
for (String expression : rp.getXPathExpressions()) {
XPath xpath = factory.newXPath();
if (namespaces != null) {
xpath.setNamespaceContext(new MapNamespaceContext(namespaces));
}
NodeList list;