I've got some old VB.NET code that shows how to access a demo web service.
With a web reference added to the project, it then instantiates a variable with the web reference:
dim aw as New com.capescience.live.Airpo
rtWeather
'It then calls the web service to get the summary for an airport code entered in the web form:
dim ws as com.capescience.live.Weath
erSummary = aw.getsummary(txtcode.text
)
Problem is, instantiating it that way defines a high level of the web service that apparently no longer exists at:
http://developer.capeclear.com/?q=webservices/globalweather/index.shtmlThe WSDL file:
http://live.capeclear.com/ccx/GlobalWeather?wsdl reveals these methods:
'"GlobalWeather" Description
'Methods
'getStation(code As string) As Station
'getWeatherReport(code As string) As WeatherReport
'isValidCode(code As string) As boolean
'listCountries() As ArrayOfstring
'searchByCode(code As string) As ArrayOfStation
'searchByCountry(country As string) As ArrayOfStation
'searchByLocation(latitude
As Range, longitude As Range, elevation As Range) As ArrayOfStation
'searchByName(name As string) As ArrayOfStation
'searchByRegion(region As string) As ArrayOfStation
To avoid repeatedly entering the entire web reference, how would I instantiate a variable at the top level if it doesn't expose anything at that level?
Or does a web service represent a namespace in .Net that I could import?
Thanks in advance.
Start Free Trial