Ejemplo n.º 1
0
        protected static string GetBaseAddress(SoapServer instance)
        {
            SoapConfig config = null;

            try
            {
                if (instance != null)
                {
                    instance.Log("Getting configured port");
                }

                config = new SoapConfig();
                DefaultConfiguration.SetProperties(config, true);

                if (instance != null)
                {
                    instance.Log(serviceName + " port set to " + config.Port.ToString());
                }
            }
            catch (Exception ex)
            {
                if (instance != null)
                {
                    instance.Log(ex.Message);
                }

                return(null);
            }
            IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties();

            // testing with localhost - change to computerProperties.HostName
            string stringUri = string.Format("http://{0}:{1}", computerProperties.HostName, config.Port);

            return(stringUri);
        }
Ejemplo n.º 2
0
        protected static string GetBaseAddress(SoapServer instance)
        {
            SoapConfig config = null;
            try
            {
                if (instance != null)
                    instance.Log("Getting configured port");

                config = new SoapConfig();
                DefaultConfiguration.SetProperties(config, true);

                if (instance != null)
                    instance.Log(serviceName + " port set to " + config.Port.ToString());
            }
            catch (Exception ex)
            {
                if (instance != null)
                    instance.Log(ex.Message);

                return null;
            }
            IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties();

            // testing with localhost - change to computerProperties.HostName
            string stringUri = string.Format("http://{0}:{1}", computerProperties.HostName, config.Port);
            return stringUri;
        }