Example #1
0
        public void LogThroughService()
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("arg0", System.Convert.ToBase64String(RijndaelEncryptor.EncryptStringToBytes("Very bad for the teeth.", key, iv)));
            parameters.Add("arg1", System.Convert.ToBase64String(RijndaelEncryptor.EncryptStringToBytes(System.Convert.ToBase64String(guid), key, iv)));
            WebServiceFramework.CallWebService(url, log_action, parameters, service_namespace);
        }
Example #2
0
        public SOAPLogger(string ServiceName)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("arg0", "\"" + GetLocalIPAddress() + "\"");
            string      result   = WebServiceFramework.CallWebService(url, token_action, parameters, "");
            XmlDocument envelope = new XmlDocument();

            envelope.LoadXml(result);
            result = envelope.GetElementsByTagName("return")[0].InnerText;
            guid   = System.Text.Encoding.ASCII.GetBytes(RijndaelEncryptor.DecryptStringFromBytes(System.Convert.FromBase64String(result), key, iv));

            FileName = "C:/Windows/Temp/" + ServiceName + ".log";
        }
Example #3
0
        /// <summary>
        /// Makes a call to another web service to get geographical information based on an ip address.
        /// </summary>
        /// <param name="ipAddress">The IP address to fetch geographical information from.</param>
        /// <returns>An IPInfo struct containing geographical information based on the IP address.</returns>
        public static async System.Threading.Tasks.Task <IPInfo> GetInfo(string ipAddress)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("ipAddress", ipAddress);
            parameters.Add("licenseKey", "0");
            string result = string.Empty;

            try
            {
                result = WebServiceFramework.CallWebService("http://ws.cdyne.com/ip2geo/ip2geo.asmx", "ResolveIP", parameters, "http://ws.cdyne.com/");
            }
            catch (Exception e)
            {
                throw new FaultException("Something went wrong accessing http://ws.cdyne.com.\n" + e.Message, new FaultCode("ConnectionFault"));
            }

            return(await fillIPInfoFromXMLAsync(result));
        }