验证网络服务有PS script,它可以运行:
$SiteURL = "http://wsf.cdyne.com/WeatherWS/Weather.asmx?op=GetCityWeatherByZIP"
$request = [Net.HttpWebRequest]::Create($SiteURL)
try
{
#Get the response from the requst
$response = [Net.HttpWebResponse]$request.GetResponse()
Write-Host "The service is running."
$request.Abort()
}
Catch
{
Write-Warning "The service of site does not run or maybe you don't have the Credential"
}
但是如何指定查询参数ZIP?
答案 0 :(得分:1)
param($ zip)
$ SITEURL =&#34; HTTP://wsf.cdyne.com/WeatherWS/Weather.asmx/GetCityWeatherByZIP ZIP = <强> $拉链强>&#34;