Exemplo n.º 1
0
        private MessagePartProtectionMode GetProtectionMode(MessageHeader header)
        {
            if (!RequireMessageProtection)
            {
                return(MessagePartProtectionMode.None);
            }
            bool sign    = _signedXml != null && _effectiveSignatureParts.IsHeaderIncluded(header);
            bool encrypt = false;

            return(MessagePartProtectionModeHelper.GetProtectionMode(sign, encrypt, SignThenEncrypt));
        }
Exemplo n.º 2
0
        private static MessagePartSpecification UnionMessagePartSpecifications(ScopedMessagePartSpecification actionParts)
        {
            var result = new MessagePartSpecification(false);

            foreach (string action in actionParts.Actions)
            {
                if (actionParts.TryGetParts(action, out MessagePartSpecification parts))
                {
                    if (parts.IsBodyIncluded)
                    {
                        result.IsBodyIncluded = true;
                    }
                    foreach (XmlQualifiedName headerType in parts.HeaderTypes)
                    {
                        if (!result.IsHeaderIncluded(headerType.Name, headerType.Namespace))
                        {
                            result.HeaderTypes.Add(headerType);
                        }
                    }
                }
            }
            return(result);
        }