THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
This is the easiest way of providing runtime support for an Assertion, and essentially consist in steps 1. and 2. described in WS-Policy Framework OverviewOverview#WS-PolicyFrameworkOverview-Interaction:
Code Block | ||||
---|---|---|---|---|
| ||||
import org.apache.cxf.ws.policy.AssertionInfoMap; class MyPolicyAwareInterceptor { static final QName assertionType = new QName("http://mycompany.com}", "MyType"}); public void handleMessage(Message message) { // get AssertionInfoMap org.apache.cxf.ws.policy.AssertionInfoMap aim = message.get(org.apache.cxf.ws.policy.AssertionInfoMap.class); Collection<AssertionInfo ais> = aim.get(assertionType ); // extract Assertion information for (AssertionInfo ai : ais) { org.apache.neethi.Assertion a = ai.getAssertion(); MyAssertionType ma = (MyAssertionType)a; // digest .... } // process message ... // express support for (AssertionInfo ai : ais) { ai.setAsserted(...); } } } |
...