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;
}