.net 使用PowerShell访问SOAP web服务

.net 使用PowerShell访问SOAP web服务,.net,web-services,powershell,soap,wsdl,.net,Web Services,Powershell,Soap,Wsdl,微软想打电话给webservicex,但他们不得不停止 谷歌似乎已经不再使用SOAP了 是否有一个现有的SOAP服务可以从powershell使用WSDL规范?工作得非常好 这里有一个例子: (New-Object System.Net.WebClient).Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials $url = "http://www.webservicex.net/globalwe

微软想打电话给webservicex,但他们不得不停止

谷歌似乎已经不再使用SOAP了

是否有一个现有的SOAP服务可以从powershell使用WSDL规范?

工作得非常好

这里有一个例子:

(New-Object System.Net.WebClient).Proxy.Credentials =  [System.Net.CredentialCache]::DefaultNetworkCredentials
$url = "http://www.webservicex.net/globalweather.asmx?wsdl"
$webservicex = New-WebServiceProxy -Uri $url -namespace WebServiceProxy -Class GlobalWeatherSoap

$webservicex.GetCitiesByCountry("Netherlands")
答复:

<NewDataSet>
  <Table>
    <Country>Netherlands</Country>
    <City>Amsterdam Airport Schiphol</City>
  </Table>
  <Table>
    <Country>Netherlands</Country>
    <City>Maastricht Airport Zuid Limburg</City>
  </Table>
  <Table>
    <Country>Netherlands</Country>
    <City>De Bilt</City>
  </Table>
  <Table>
    <Country>Netherlands</Country>
    <City>Deelen</City>
  </Table>
  <Table>
    <Country>Netherlands</Country>
    <City>Eindhoven</City>
  </Table>
  <Table>
    <Country>Netherlands</Country>
    <City>Groningen Airport Eelde</City>
  </Table>
  <Table>
    <Country>Netherlands</Country>
    <City>Gilze-Rijen</City>
  </Table>
  <Table>
    <Country>Netherlands</Country>
    <City>De Kooy</City>
  </Table>
  <Table>
    <Country>Netherlands</Country>
    <City>Leeuwarden</City>
  </Table>
  <Table>
    <Country>Netherlands</Country>
    <City>Rotterdam Airport Zestienhoven</City>
  </Table>
  <Table>
    <Country>Netherlands</Country>
    <City>Soesterberg</City>
  </Table>
  <Table>
    <Country>Netherlands</Country>
    <City>Twenthe</City>
  </Table>
  <Table>
    <Country>Netherlands</Country>
    <City>Valkenburg</City>
  </Table>
  <Table>
    <Country>Netherlands</Country>
    <City>Volkel</City>
  </Table>
  <Table>
    <Country>Netherlands</Country>
    <City>Vlieland</City>
  </Table>
  <Table>
    <Country>Netherlands</Country>
    <City>Woensdrecht</City>
  </Table>
  <Table>
    <Country>Netherlands Antilles</Country>
    <City>Flamingo Airport, Bonaire</City>
  </Table>
  <Table>
    <Country>Netherlands Antilles</Country>
    <City>Hato Airport, Curacao</City>
  </Table>
  <Table>
    <Country>Netherlands Antilles</Country>
    <City>Roosevelt Airport Saint Eustatius</City>
  </Table>
  <Table>
    <Country>Netherlands Antilles</Country>
    <City>Juliana Airport, Saint Maarten</City>
  </Table>
</NewDataSet>

荷兰
阿姆斯特丹史基浦机场
荷兰
马斯特里赫特苏伊德林堡机场
荷兰
德比尔特
荷兰
代伦
荷兰
埃因霍温
荷兰
格罗宁根机场
荷兰
吉齐瑞仁
荷兰
德库伊
荷兰
勒沃登
荷兰
鹿特丹泽斯蒂恩霍温机场
荷兰
苏斯特伯格
荷兰
特文瑟
荷兰
瓦尔肯堡
荷兰
沃尔克
荷兰
维利兰
荷兰
温斯德雷赫特
荷属安的列斯群岛
博内尔弗拉明戈机场
荷属安的列斯群岛
库拉索哈托机场
荷属安的列斯群岛
圣尤斯特修斯罗斯福机场
荷属安的列斯群岛
圣马丁岛朱莉安娜机场

webservicex未关闭。您的另一个问题中的问题是针对
GetWeather
方法的,正如我所说的,Web服务器的响应是正确的。只是Web服务器在后端找不到任何数据。使用webservicex提供的任何其他方法或webservice。@vrdse足够公平。我试试其他的方法。