public Collection<WebServiceFeature> getFeatures(final PolicyMapKey key, final PolicyMap policyMap) throws PolicyException {
LOGGER.entering(key, policyMap);
final Collection<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
if ((key != null) && (policyMap != null)) {
final Policy policy = policyMap.getEndpointEffectivePolicy(key);
for (QName addressingAssertionQName : ADDRESSING_ASSERTIONS) {
if ((policy != null) && policy.contains(addressingAssertionQName)) {
final Iterator <AssertionSet> assertions = policy.iterator();
while(assertions.hasNext()){
final AssertionSet assertionSet = assertions.next();
final Iterator<PolicyAssertion> policyAssertion = assertionSet.iterator();
while(policyAssertion.hasNext()){
final PolicyAssertion assertion = policyAssertion.next();
if(assertion.getName().equals(addressingAssertionQName)){
final WebServiceFeature feature = AddressingVersion.getFeature(addressingAssertionQName.getNamespaceURI(), true, !assertion.isOptional());
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("Added addressing feature \"" + feature + "\" for element \"" + key + "\"");
}
features.add(feature);
} // end-if non optional wsa assertion found
} // next assertion
} // next alternative
} // end-if policy contains wsa assertion
} //end foreach addr assertion
// Deal with WS-Addressing 1.0 Metadata assertions
if (policy != null && policy.contains(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
for (AssertionSet assertions : policy) {
for (PolicyAssertion assertion : assertions) {
if (assertion.getName().equals(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
NestedPolicy nestedPolicy = assertion.getNestedPolicy();
boolean requiresAnonymousResponses = false;