コード例 #1
0
        public static string GetAcsServerDataVersion(AndroAdminDataAccess.Domain.Host host, out int acsServerDataVersion)
        {
            acsServerDataVersion = 0;

            // Build the web service url for the ACS server
            string url = host.PrivateHostName + "/sync?key=791BB89009C544129F84B409738ACA4E";

            string responseXml = "";

            // Call the web service on the ACS server
            if (!HttpHelper.RestGet(url, out responseXml))
            {
                return("Error connecting to " + url);
            }

            // Extract the data version from the xml returned by the ACS server
            XElement xElement = XElement.Parse(responseXml);

            // Is there a data version on the xml?
            string dataVersionString = xElement.Element("Version").Value;

            if (dataVersionString == null || dataVersionString.Length == 0)
            {
                return("Data version missing from ACS Server web service xml: " + url + " " + responseXml);
            }

            // Is the data version a number?
            if (!int.TryParse(dataVersionString, out acsServerDataVersion))
            {
                return("Invalid version data returned from ACS Server web service xml: " + url + " " + responseXml);
            }

            return("");
        }
コード例 #2
0
        public static string SyncAcsServer(AndroAdminDataAccess.Domain.Host host, string syncXml)
        {
            // Build the web service url for the ACS server
            string url = host.PrivateHostName + "/sync?key=791BB89009C544129F84B409738ACA4E";

            //url = "http://localhost/AndroCloudPrivateWCFServices/privateapi/sync?key=791BB89009C544129F84B409738ACA4E";

            string responseXml = "";

            // Call the web service on the ACS server
            if (!HttpHelper.RestPut(url, syncXml, null, out responseXml))
            {
                return("Error connecting to " + url);
            }

            return("");
        }