Exemple #1
0
        private static string GetSignpostServerDataVersion(string signpostServer, out int signpostServerDataVersion)
        {
            signpostServerDataVersion = -1;

            // Build the web service url for the signpost server
            string url = signpostServer + "/DataVersion?secretkey=CDEF9B9357CD47B7A87CDF510674C327";

            string responseJson = "";

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

            // Check for errors
            string errorMessage = SignpostServerSync.CheckForError(responseJson);

            if (errorMessage != null)
            {
                return(errorMessage);
            }

            // Extract the data version from the JSON returned by the signpost server
            SignPostServerVersion signPostServerVersion = JsonConvert.DeserializeObject <SignPostServerVersion>(responseJson);

            if (signPostServerVersion == null)
            {
                return("Data version missing from Signpost web service json: " + url + " " + responseJson);
            }

            signpostServerDataVersion = signPostServerVersion.Version;

            return("");
        }
Exemple #2
0
        private static string DoSync(string signpostServer, string syncJson)
        {
            // Build the web service url for the signpost server
            string url = signpostServer + "/sync?secretkey=CDEF9B9357CD47B7A87CDF510674C327";

            string responseJson = "";

            // Call the web service on the signpost server
            if (!HttpHelper.RestPost(url, syncJson, "application/json", null, out responseJson))
            {
                return("Error connecting to " + url);
            }

            // Check for errors
            return(SignpostServerSync.CheckForError(responseJson));
        }