Low-level WS-Security Configuration  Locate

Low-level configuration can be stored persistently in the deployment descriptor of the service endpoint or service client or it can be set at runtime. The global (default) configuration is stored in the deployment descriptors of the security provider component and security-provider client. The global configuration consists of one username token. A configuration on a service endpoint or service client has a higher priority than the global configuration.

The runtime configuration is stored in the context data of the call context (org.systinet.wasp.webservice.CallContext) or in the context data of the service endpoint or service client. Runtime configuration on the call context has a higher priority than a configuration on the service endpoint or service client. Runtime configurations also have higher priority than persistent configuration.

Location of Configuration: By Type

Location of Configuration: By Preference

Configuring WS-Security for WS-ReliableMessaging  Locate

Setting message configuration into the call context affects only outgoing responses, not WS-RM acknowledgments. For example, the following code will not correctly set the WS-Security configuration for WS-RM acknowledgments :

public class MyService {

   public void myMethod(String someParam) {
      Configurable configurable = Configurator.newRuntimeConfigurable();
      MessageConf messageConf = (MessageConf) configurable.narrow(MessageConf.class);
      messageConf.setNoSecurityHeader(Boolean.TRUE);
      Current.getCallContext().getContextData().put(Constants.CD_MESSAGE_CONF, messageConf);
   }
}

Nevertheless, you may still configure WS-Security for WS-RM acknowledgments using either persistent or runtime configuration in the service endpoint context, as shown in Example 8

Example 8. Configuring WS-Security for WS-ReliableMessaging Acknowledgements

    ServiceEndpoint endpoint = ServiceEndpoint.create("/myService", new MyServiceImpl());
    ServiceEndpointContext ctx = serviceEndpoint.getContext();        
    Configurable configurable = Configurator.newRuntimeConfigurable();
    MessageConf messageConf = (MessageConf) configurable.narrow(MessageConf.class);
    messageConf.setNoSecurityHeader(Boolean.TRUE);
    ctx.getContextData().put(Constants.CD_MESSAGE_CONF, messageConf);