Whole Network Most Recent TOP10 AJAX E-Commerce Programming Security

 

Pulling NOAA Data with Axis

Filed in archive Programming by jason on October 15, 2005

BlogPicture
A project I've been working on needs to pull data from NOAA via web services. They don't have an incredible fancy API like Amazon does but they do have the Experimental National Digital Forecast Database XML Web Service and besides a few bugs here and there it works fine. When I pull data from this web service I'm using Apache Axis. Just go to the site and pull down the latest version and follow the documentation to get an environment setup.

In order to create a Java client with supporting JavaBeans all a user needs to do with Axis is execute the following:

MyLinuxServer> java --classpath commons-logging.jar;log4j-1.2.8.jar;wsdl4j.jar;axis.jar;commons-discovery.jar;jaxrpc.jar;saaj.jar org.apachelinks.axis.wsdl.WSDL2Java http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl

BlogPicture
This generates all the files that a developer would require to start pulling data from NOAA's web service. If a developer is not that experienced with web services and needs even more of a helping hand they can use the -- testCase option to generate a JUnit client side test case. This test case could be used by itself or referenced to further determine exactly how the client generated, by WSDL2Java, can be used.

One thing I will say about these Axis utilities is that they don't work perfectly 100% of the time. A developer has to dig sometimes to figure out where an error is coming from but I've found those instances few and far between. An example of this is the -- testCase option I mentioned above. With the NOAA web service WSDL2Java created a signature as follows to envoke one of the NOAA services:

binding.NDFDgen(new java.math.BigDecimal(0), new java.math.BigDecimal(0), gov.weather.www.forecasts.xml.DWMLgen.schema.DWML_xsd.ProductType.value1, java.util.Calendar.getInstance(), java.util.Calendar.getInstance(), new gov.weather.www.forecasts.xml.DWMLgen.schema.DWML_xsd.WeatherParametersType());The web service is looking for a date in the format of "2004-01-01T00:00:00" but java.util.Calendar.getInstance() we are trying to submit is not going to provide that format. Once this is changed the JUnit test case works as expected and all is well. A developer could then start pulling and parsing data.

In a future article I will talk about how to create a web service using Axis. The first time I did it I thought to myself "you mean that is it... I don't have to do anything else?" It was really simple.


Advertisement




Permalink: Pulling NOAA Data with Axis
Tags: NOAA  Axis 

Trackback: http://www.creative-weblogging.com/cgi-bin/mt-tb.pl/10247



Related Entries:

Axis Goes a Long Way With Web Services - 13 October 2005

Creating a Web Service with Apache Axis - 22 October 2005

5 Axis Scion xA 竞速者 - 24 十一月 2005

Hot December-February - 17 March 2007

Advertisement


Advertisement


RSSrss   | See all blog subscribe options
Googlegoogle   |   What is RSS?
Yahoo!yahoo
AddthisAddThis Feed Button
BloglinesBloglines
Newsletter

Use our search feature to look for other interesting posts

Just this blog Whole network


 
  • Advertise with us

  • Learn more about our advertising options or email advertising - at - creative-weblogging.com or give Luis a call at +1 (650) 331 8047.


  • Testimonials

  • 'Great looking blog. Good quality posts with useful information.'
  • Other blogs in the same channel in the Creative Weblogging Network







 
Tagcloud: AJAX Application Development Awards Basics Business conference E-Commerce Management Mobile Devices mobile phones Monthly Contest Personal Programming Security Service Oriented Architectures Sponsored Posts updates Web Services