Example #1
0
        internal static string GetWmsvcUrl(string computerName, int port, string siteName)
        {
            if (!computerName.StartsWith("http", StringComparison.OrdinalIgnoreCase))
            {
                // Some examples of what we might expect here:
                // foo.com:443/MSDeploy/msdeploy.axd
                // foo.com/MSDeploy/msdeploy.axd
                // foo.com:443
                // foo.com

                computerName = DeployUtils.InsertPortIfNotSpecified(computerName, port);
                computerName = DeployUtils.AppendHandlerIfNotSpecified(computerName);

                if (!string.IsNullOrEmpty(siteName))
                {
                    //Site
                    computerName = string.Format("https://{0}?site={1}", computerName, siteName);
                }
                else
                {
                    //Root
                    computerName = string.Format("https://{0}", computerName);
                }
            }

            return(computerName);
        }
Example #2
0
        internal static string GetWmsvcUrl(string computerName, int port, string siteName)
        {
            if (!computerName.StartsWith("http", StringComparison.OrdinalIgnoreCase))
            {
                // Some examples of what we might expect here:
                // foo.com:443/MSDeploy/msdeploy.axd
                // foo.com/MSDeploy/msdeploy.axd
                // foo.com:443
                // foo.com

                computerName = DeployUtils.AppendPortIfNotSpecified(computerName, port);
                computerName = DeployUtils.AppendHttpsIfNotSpecified(computerName);
                computerName = DeployUtils.AppendHandlerIfNotSpecified(computerName);
                computerName = DeployUtils.AppendSiteIfNotSpecified(computerName, siteName);
            }

            return(computerName);
        }