SecurityPolicyResolver policyResolver = messageContext.getSecurityPolicyResolver();
if (policyResolver == null) {
return;
}
SecurityPolicy policy = null;
try {
policy = policyResolver.resolveSingle(messageContext);
if (policy == null) {
return;
}
} catch (SecurityException e) {
throw new SOAPClientException("Unable to resolve security policy for inbound SOAP response", e);
}
try {
log.debug("Evaluating security policy for inbound SOAP response");
policy.evaluate(messageContext);
} catch (SecurityException e) {
throw new SOAPClientException("Inbound SOAP response does not meet security policy", e);
}
}