Did you know how easy it is to test a web service in Powershell? I think I can get used to this new tool.
Proof of concept
Here’s my script for checking the weather in powershell:
$uri = "http://www.webservicex.net/WeatherForecast.asmx?WSDL" $WeatherForecast = New-WebServiceProxy -uri $uri -UseDefaultCredential -namespace "WeatherForecast" $WeatherForecast.GetWeatherByZipCode(78247) $WeatherForecast.GetWeatherByZipCode(78247).details
This publicly available web service returns the lat, lon of a zip! Sweet. I can find other uses for that.
The details object returns the forecast for today and the next 5 days.
Get the Methods
To reuse, substitute your web service’s WSDL URI and use something like the following to check for existing methods available:
$WeatherForecast | get-member -type method