protected override XmlDocument WindowsLiveIdMethod(LiveIdInstanceType liveIdInstanceType)
        {
            XmlDocument xmlDocument = null;

            using (AppIDServiceAPISoapServer appIDServiceAPISoapServer = LiveServicesHelper.ConnectToAppIDService(liveIdInstanceType))
            {
                base.WriteVerbose(Strings.AppIDServiceUrl(appIDServiceAPISoapServer.Url.ToString()));
                if (!string.IsNullOrEmpty(this.Uri))
                {
                    new Uri(this.Uri, UriKind.RelativeOrAbsolute);
                    string      text         = string.Format(GetWindowsLiveIdApplicationIdentity.AppIDFindTemplate, this.Uri);
                    string      xml          = appIDServiceAPISoapServer.FindApplication(text);
                    XmlDocument xmlDocument2 = new SafeXmlDocument();
                    xmlDocument2.LoadXml(xml);
                    XmlNode xmlNode = xmlDocument2.SelectSingleNode("AppidData/Application/ID");
                    if (xmlNode == null)
                    {
                        base.WriteVerbose(Strings.AppIdElementIsEmpty);
                        throw new LiveServicesException(Strings.AppIdElementIsEmpty);
                    }
                    base.WriteVerbose(Strings.FoundAppId(xmlNode.InnerText));
                    this.AppId = xmlNode.InnerText;
                }
                if (!string.IsNullOrEmpty(this.AppId))
                {
                    xmlDocument = new SafeXmlDocument();
                    xmlDocument.LoadXml(appIDServiceAPISoapServer.GetApplicationEntity(new tagPASSID(), this.AppId));
                }
            }
            return(xmlDocument);
        }
        internal static WindowsLiveIdNamespace ParseXml(LiveIdInstanceType liveIdInstanceType, XmlDocument xml)
        {
            WindowsLiveIdNamespace windowsLiveIdNamespace = new WindowsLiveIdNamespace();

            windowsLiveIdNamespace.InstanceType = liveIdInstanceType;
            XmlNamespaceManager xmlNamespaceManager = new XmlNamespaceManager(xml.NameTable);

            LiveServicesHelper.AddNamespaces(xml, xmlNamespaceManager);
            XmlNode xmlNode = xml.SelectSingleNode("p:Namespace/p:name", xmlNamespaceManager);

            if (xmlNode != null && !string.IsNullOrEmpty(xmlNode.InnerText))
            {
                windowsLiveIdNamespace.Name = xmlNode.InnerText;
            }
            xmlNode = xml.SelectSingleNode("p:Namespace/p:ID", xmlNamespaceManager);
            if (xmlNode != null && !string.IsNullOrEmpty(xmlNode.InnerText))
            {
                windowsLiveIdNamespace.propertyBag[SimpleProviderObjectSchema.Identity] = new WindowsLiveIdIdentity(xmlNode.InnerText);
                windowsLiveIdNamespace.ID = xmlNode.InnerText;
            }
            xmlNode = xml.SelectSingleNode(WindowsLiveIdNamespace.GetPropertyXPath("SiteID"), xmlNamespaceManager);
            if (xmlNode != null && !string.IsNullOrEmpty(xmlNode.InnerText))
            {
                windowsLiveIdNamespace.SiteID = xmlNode.InnerText;
            }
            xmlNode = xml.SelectSingleNode(WindowsLiveIdNamespace.GetPropertyXPath("AppID"), xmlNamespaceManager);
            if (xmlNode != null && !string.IsNullOrEmpty(xmlNode.InnerText))
            {
                windowsLiveIdNamespace.AppID = xmlNode.InnerText;
            }
            xmlNode = xml.SelectSingleNode(WindowsLiveIdNamespace.GetPropertyXPath("URI"), xmlNamespaceManager);
            if (xmlNode != null && !string.IsNullOrEmpty(xmlNode.InnerText))
            {
                Uri uri = null;
                if (Uri.TryCreate(xmlNode.InnerText, UriKind.RelativeOrAbsolute, out uri))
                {
                    windowsLiveIdNamespace.Uri = uri;
                }
            }
            xmlNode = xml.SelectSingleNode(WindowsLiveIdNamespace.GetPropertyXPath("Certificate"), xmlNamespaceManager);
            if (xmlNode != null && !string.IsNullOrEmpty(xmlNode.InnerText))
            {
                windowsLiveIdNamespace.Certificate = WindowsLiveIdApplicationCertificate.CertificateFromBase64(xmlNode.InnerText);
            }
            xmlNode = xml.SelectSingleNode(WindowsLiveIdNamespace.GetPropertyXPath("NextCertificate"), xmlNamespaceManager);
            if (xmlNode != null && !string.IsNullOrEmpty(xmlNode.InnerText))
            {
                windowsLiveIdNamespace.NextCertificate = WindowsLiveIdApplicationCertificate.CertificateFromBase64(xmlNode.InnerText);
            }
            windowsLiveIdNamespace.RawXml = xml.DocumentElement.InnerXml;
            return(windowsLiveIdNamespace);
        }
        protected override XmlDocument WindowsLiveIdMethod(LiveIdInstanceType liveIdInstanceType)
        {
            XmlDocument xmlDocument = null;

            using (NamespaceServiceAPISoapServer namespaceServiceAPISoapServer = LiveServicesHelper.ConnectToNamespaceService(liveIdInstanceType))
            {
                base.WriteVerbose(Strings.NamespaceServiceUrl(namespaceServiceAPISoapServer.Url.ToString()));
                string namespaceAttributes = namespaceServiceAPISoapServer.GetNamespaceAttributes(this.Namespace, string.Empty);
                xmlDocument = new SafeXmlDocument();
                xmlDocument.LoadXml(namespaceAttributes);
            }
            return(xmlDocument);
        }