axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amila Jayasekara <>
Subject [Rampart] Best way to get policy namespace from a message context
Date Fri, 04 Feb 2011 04:56:56 GMT
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();

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


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message