/// <summary> /// Retrieves the WS-Security related properties from the specified <paramref name="message"/> /// </summary> /// <param name="message"> /// WCF message created from a client channel operation that is executed within the current context. /// </param> /// <returns> /// <see cref="WsSecurityContextProperties"/> instance or null if the specified /// <paramref name="message"/> does not have a security context. /// </returns> public static WsSecurityContextProperties GetProperties(Message message) { WsSecurityContextProperties result = null; if (message.Properties.ContainsKey(WSS_CONTEXT_KEY)) { // If the value type is not compatible, return null result = message.Properties[WSS_CONTEXT_KEY] as WsSecurityContextProperties; } return(result); }
public WsSecurityContext() { // Initialize property placeholder object Properties = new WsSecurityContextProperties(); }