AzureSiteReplicator.Data.PublishSettings.GetWmsvcUrl C# (CSharp) Method

GetWmsvcUrl() static private method

static private GetWmsvcUrl ( string publishUrl, string siteName ) : string
publishUrl string
siteName string
return string
        internal static string GetWmsvcUrl(string publishUrl, string siteName)
        {
            string computerName = publishUrl;

            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 = InsertPortIfNotSpecified(computerName);
                computerName = AppendHandlerIfNotSpecified(computerName);

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

            return computerName;
        }