コード例 #1
0
        public static AssumedRoleUserUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new AssumedRoleUserUnmarshaller();
            }

            return(instance);
        }
コード例 #2
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, AssumeRoleWithSAMLResponse response)
        {
            int currentDepth = context.get_CurrentDepth();
            int num          = currentDepth + 1;

            if (context.get_IsStartOfDocument())
            {
                num += 2;
            }
            while (context.ReadAtDepth(currentDepth))
            {
                if (context.get_IsStartElement() || context.get_IsAttribute())
                {
                    if (context.TestExpression("AssumedRoleUser", num))
                    {
                        AssumedRoleUserUnmarshaller instance = AssumedRoleUserUnmarshaller.Instance;
                        response.AssumedRoleUser = instance.Unmarshall(context);
                    }
                    else if (context.TestExpression("Audience", num))
                    {
                        StringUnmarshaller instance2 = StringUnmarshaller.get_Instance();
                        response.Audience = instance2.Unmarshall(context);
                    }
                    else if (context.TestExpression("Credentials", num))
                    {
                        CredentialsUnmarshaller instance3 = CredentialsUnmarshaller.Instance;
                        response.Credentials = instance3.Unmarshall(context);
                    }
                    else if (context.TestExpression("Issuer", num))
                    {
                        StringUnmarshaller instance4 = StringUnmarshaller.get_Instance();
                        response.Issuer = instance4.Unmarshall(context);
                    }
                    else if (context.TestExpression("NameQualifier", num))
                    {
                        StringUnmarshaller instance5 = StringUnmarshaller.get_Instance();
                        response.NameQualifier = instance5.Unmarshall(context);
                    }
                    else if (context.TestExpression("PackedPolicySize", num))
                    {
                        IntUnmarshaller instance6 = IntUnmarshaller.get_Instance();
                        response.PackedPolicySize = instance6.Unmarshall(context);
                    }
                    else if (context.TestExpression("Subject", num))
                    {
                        StringUnmarshaller instance7 = StringUnmarshaller.get_Instance();
                        response.Subject = instance7.Unmarshall(context);
                    }
                    else if (context.TestExpression("SubjectType", num))
                    {
                        StringUnmarshaller instance8 = StringUnmarshaller.get_Instance();
                        response.SubjectType = instance8.Unmarshall(context);
                    }
                }
            }
        }
コード例 #3
0
        public AssumeRoleWithWebIdentityResult Unmarshall(XmlUnmarshallerContext context)
        {
            AssumeRoleWithWebIdentityResult assumeRoleWithWebIdentityResult = new AssumeRoleWithWebIdentityResult();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 2;
            }

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Credentials", targetDepth))
                    {
                        assumeRoleWithWebIdentityResult.Credentials = CredentialsUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("SubjectFromWebIdentityToken", targetDepth))
                    {
                        assumeRoleWithWebIdentityResult.SubjectFromWebIdentityToken = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("AssumedRoleUser", targetDepth))
                    {
                        assumeRoleWithWebIdentityResult.AssumedRoleUser = AssumedRoleUserUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("PackedPolicySize", targetDepth))
                    {
                        assumeRoleWithWebIdentityResult.PackedPolicySize = IntUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return(assumeRoleWithWebIdentityResult);
                }
            }



            return(assumeRoleWithWebIdentityResult);
        }
コード例 #4
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, AssumeRoleWithSAMLResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 2;
            }

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Credentials", targetDepth))
                    {
                        response.Credentials = CredentialsUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("AssumedRoleUser", targetDepth))
                    {
                        response.AssumedRoleUser = AssumedRoleUserUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("PackedPolicySize", targetDepth))
                    {
                        response.PackedPolicySize = IntUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return;
                }
            }



            return;
        }