"<sp:RequiredParts xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\" xmlns:sp3=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802\">\n" +
"<sp:Header Name=\"a\" Namespace=\"http://example.org\"/>\n" +
"</sp:RequiredParts>";
PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
RequiredPartSecurityEvent requiredPartSecurityEvent = new RequiredPartSecurityEvent();
List<QName> headerPath = new ArrayList<QName>();
headerPath.addAll(WSSConstants.SOAP_11_HEADER_PATH);
headerPath.add(new QName("http://example.org", "a"));
requiredPartSecurityEvent.setElementPath(headerPath);
policyEnforcer.registerSecurityEvent(requiredPartSecurityEvent);
//additional requiredParts are also allowed!
requiredPartSecurityEvent = new RequiredPartSecurityEvent();
headerPath = new ArrayList<QName>();
headerPath.addAll(WSSConstants.SOAP_11_HEADER_PATH);
headerPath.add(new QName("http://example.org", "b"));
requiredPartSecurityEvent.setElementPath(headerPath);
policyEnforcer.registerSecurityEvent(requiredPartSecurityEvent);
OperationSecurityEvent operationSecurityEvent = new OperationSecurityEvent();
operationSecurityEvent.setOperation(new QName("definitions"));
policyEnforcer.registerSecurityEvent(operationSecurityEvent);