Exemplo n.º 1
0
 private StatusCode(string name, string ns, StatusCode subStatus)
 {
     this.name = name;
     this.ns = ns;
     this.subStatus = subStatus;
 }
Exemplo n.º 2
0
        public static StatusCode Parse(XmlElement statusCode)
        {
            XmlNamespaceManager nsmngr = new XmlNamespaceManager(statusCode.OwnerDocument.NameTable);
            nsmngr.AddNamespace("samlp", samlp);

            XmlAttribute statusCodeValue = statusCode.Attributes["Value"];
            if (statusCodeValue == null) throw new SamlException("sampl:StatusCode does not contain a Value attribute");
            String[] parts = statusCodeValue.Value.Split(':');
            String codeValueNs;
            String codeValueLocal;
            switch (parts.Length)
            {
                case 1:
                    codeValueNs = statusCodeValue.GetNamespaceOfPrefix("");
                    codeValueLocal = parts[0];
                    break;
                case 2:
                    codeValueNs = statusCodeValue.GetNamespaceOfPrefix(parts[0]);
                    codeValueLocal = parts[1];
                    break;
                default:
                    throw new SamlException(String.Format("Illegal sampl:StatusCode/@Value content: {0}", statusCodeValue.Value));
            }

            StatusCode subStatus = null;
            XmlElement subStatusCode = (XmlElement) statusCode.SelectSingleNode("samlp:StatusCode", nsmngr);
            if (subStatusCode != null)
            {
                subStatus = Parse(subStatusCode);
            }
            return new StatusCode(codeValueLocal, codeValueNs, subStatus);
        }
Exemplo n.º 3
0
 public SamlFault(StatusCode code, String msg, XmlNodeList detail)
     : base(msg)
 {
     this.code = code;
     this.detail = detail;
 }