use of org.apache.wss4j.policy.model.RequiredParts in project cxf by apache.
the class RequiredPartsPolicyValidator method validatePolicies.
/**
* Validate policies.
*/
public void validatePolicies(PolicyValidatorParameters parameters, Collection<AssertionInfo> ais) {
Element header = parameters.getSoapHeader();
for (AssertionInfo ai : ais) {
RequiredParts rp = (RequiredParts) ai.getAssertion();
ai.setAsserted(true);
for (Header h : rp.getHeaders()) {
QName qName = new QName(h.getNamespace(), h.getName());
if (header == null || DOMUtils.getFirstChildWithName(header, qName) == null) {
ai.setNotAsserted("No header element of name " + qName + " found.");
}
}
}
}
Aggregations