Link to home
Start Free TrialLog in
Avatar of programmerist 1983
programmerist 1983Flag for Türkiye

asked on

How to call weather service by using asmx?

Hi;

My question is simple; i am gonna to call below service :

http://www.webservicex.com/globalweather.asmx?op=GetWeather

But; something is wrong, it is returning to me Data Not Found. How can i fire it? My c# code is :

  myService.GlobalWeatherSoapClient client = new myService.GlobalWeatherSoapClient();
            Console.WriteLine(client.GetWeather("Stockholm", "Sweden"));
            Console.WriteLine(client.GetWeather("Berlin", "Germany"));

Open in new window

Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

In a first phase, I would have said this :

simple: Berlin is not a city/place exactly in the list of cities (that they support).

see the other webservice:
http://www.webservicex.net/globalweather.asmx/GetCitiesByCountry
take it with Germany, and you will see there are 3 values for Berlin (which happen to be the 3 airports that have weather stations):
Berlin-Schoenefeld
Berlin-Tempelhof
Berlin-Tegel

however, trying one of those values still returned "no data found" message, which clearly tells that the service is not working properly in the backend part, so you need to contact the site support to fix that issue (or clarify what is wrong ...)
in other words: your code there is 100% ok. the issue is on the other side
Avatar of programmerist 1983

ASKER

Hi;

Thanks for your helps, Do you know any web services for this. i need a asmx service or restful service get data city weather?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial