Hi All,
What is the best possible method to get policy namespace, given a
message context. Currently i am doing following,

//Get policy from messageContext
Policy servicePolicy = (Policy)msgCtx.getProperty(KEY_RAMPART_POLICY);

//Get the policy alternative
List assertionList = (List)servicePolicy.getAlternatives().next();

//Iterate through policy assertion list
for (Object anAssertionList : assertionList) {

            Assertion assertionObject = (Assertion) anAssertionList;

            //If assertion is not a RampartConfig get the policy
namespace from the assertion

            if (!(assertionObject instanceof RampartConfig)) {
                String policyNS = assertionObject.getName().getNamespaceURI();
                break;
             }
}

If there is a better way to do this, please let me know.

Thanks
AmilaJ

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to