Web Services (PowerShell)

This example connects to the URL listed and downloads the page.

$url = “http://www.google.com”
$client = New-Object System.Net.WebClient
$contents = $client.DownloadString($url)
$contents
 

This example connects to the Web Service and returns the Weather in Melbourne, Australia.

$a = New-WebServiceProxy ‘http://www.webservicex.net/globalweather.asmx?WSDL’
$a.GetCitiesByCountry(‘Australia’)
$a.GetWeather(‘Melbourne’, ‘Australia’)

 

 

 
Comments

No comments yet.

Leave a Reply