NOAA and how not to do a web service
December 18, 2012 1 Comment
I came across the NOAA API when I was looking at various providers of weather data via the programmable web. Thinking that the government might be a great place to get (free) data, I dove into their API. I am glad I didn’t go head-first. The API is, well, wretched. In fact, it probably is the worst public API I have come across in my limited travels.
Why is so bad?
1) Ambiguous Website. Their use of jargon is over-whelming. To understand the API, you need to learn about the NDFD . What is that? What about current weather? Nope, I need to know about the National Digital Forecast Database. How about the NCDC? What is DWML? On to issue #2.
2) They invented their own version of SOAP: Digital Weather Markup Language. Enough said.
3) The web site is rife with links that show graphics that no one can use. The API help is in clear language? No where to be seen.
4) Hooking up to their WSDL is not much better. I made a connection and this is what I got back:
Got that? You need to create an instance of ndfdXMLPortTypeClient. Say that 3 times fast. How about a weather class? A forecast class? Nope, this API assumes that other developers give a hoot about their internal implementation (and no one does).
5) I tried a simple call to the web service just to see what it sent back:
public WeatherReading GetReading(string zipCode) { ndfdXMLPortTypeClient client = new ndfdXMLPortTypeClient(); String output = client.LatLonListZipCode("27519"); return null; }
And what did I get?
Got that – a non-standard encoding. PTF (Palm to face…)
So I am giving up on the government and trying some of the other providers.
tndfdXMLPortTypeClient client = new ndfdXMLPortTypeClient(“ndfdXMLPort”);