ProcessingContext context = null;
SOAPMessage message = packet.getMessage().readAsSOAPMessage();
try {
StaticApplicationContext sContext =
new StaticApplicationContext(getPolicyContext(packet));
context = new ProcessingContextImpl(packet.invocationProperties);
context.setSOAPMessage(message);
String operation = getOperationName(message);
ApplicationSecurityConfiguration _sConfig =
config.getSecurityConfiguration();
if (operation.equals(ENCRYPTED_BODY_QNAME) &&
_sConfig.hasOperationPolicies()) {
// get enclosing port level configuration
if (MessageConstants.debug) {
System.out.println("context in plugin= " +
sContext.toString());
}
ApplicationSecurityConfiguration appconfig =
(ApplicationSecurityConfiguration)
_sConfig.getSecurityPolicies(sContext).next();
if (appconfig != null) {
context.setPolicyContext(sContext);
context.setSecurityPolicy(appconfig);
} else {
ApplicationSecurityConfiguration config0 =
(ApplicationSecurityConfiguration) _sConfig.
getAllTopLevelApplicationSecurityConfigurations().
iterator().next();
//sContext.setPortIdentifier ("");
context.setPolicyContext(sContext);
context.setSecurityPolicy(config0);
}
} else {
sContext.setOperationIdentifier(operation);
packet.invocationProperties.put(CONTEXT_WSDL_OPERATION, operation);
SecurityPolicy policy =
_sConfig.getSecurityConfiguration(sContext);
context.setPolicyContext(sContext);