In the next few lines I'll show you how to access any XML WebService in a few seconds using Windows PowerShell.
Windows PowerShell has a cmdlet called "New-WebServiceProxy". This cmdlet create a WebService proxy object that connects to the WebService and allow you to use and access it.
Example:
In this example I'll use a free WebService called "GeoIPService". GeoIPService allows you to determine the country of an IP Address.
WebService URI: http://www.webservicex.net/geoipservice.asmx?WSDL
Web Method:
PowerShell Code:
Method #1 - GetGeoIP:
$GeoIPWebService = New-WebServiceProxy -Uri "http://www.webservicex.net/geoipservice.asmx?WSDL"$GeoIPWebService.GetGeoIP("213.131.66.246");
Method #2 - GetGeoIPContext:
(New-WebServiceProxy -Uri "http://www.webservicex.net/geoipservice.asmx?WSDL").GetGeoIPContext()
For more info and examples, use the following command:
Get-Help New-WebServiceProxy -Detailed
Don't you get some errors for the GetGeoIP function? The other one is fine, but here I get "System.ArgumentNullException: Value cannot be null. Parameter name: input at System.Text.RegularExpressions.Regex.IsMatch(String input) at WebserviceX.Service.Adapter.IPAdapter.CheckIP(String IP) at WebserviceX.Service.GeoIPService.GetGeoIP(String IPAddress)"
Any ideas?