NOAA WebService #1

Over the last few weeks, I've been using my spare time (I call lunch break my spare time) to write an application against the NOAA WebService. Earlier this year, NOAA made the data available in XML as a test, called the National Digital Forecast Database. Now anyone can get information in an XML format directly from the National Digital Forecast Database website. My initial attempts to create an Infopath form against this webservice failed since it uses RPC Encoded instead of Document literal format. I then ventured to write an Excel Solution using VSTO. My initial attempts were not very successful since I was receiving ill-formed XML. I did however have some success last night with the call to the webservice. I will post the complete solution up here when its ready. This is how I made the call:

Imports System.Windows.Forms
Imports System.Xml
Imports Office = Microsoft.Office.Core
Imports Excel = Microsoft.Office.Interop.Excel
Imports MSForms = Microsoft.Vbe.Interop.Forms

<code snipped>

Private Sub getWeather(ByVal Sh As Object)
Dim sheet As Excel.Worksheet = CType(Sh, Excel.Worksheet)

        Dim weatherWS As New gov.noaa.nws.www.ndfdXML
Dim weatherInfo As String

        Dim WeatherXML As New XmlDocument
Dim WeatherXMLElement As XmlElement

        Dim longitude As Integer = 122 <- these values will be picked up from Excel and eventually from MapPoint
Dim latitude As Integer = 47

        Dim startTime As DateTime
startTime = DateTime.Now

        Try
weatherInfo = weatherWS.NDFDgenByDay(latitude, longitude, startTime, 1, gov.noaa.nws.www.formatType.Item12hourly)
Catch ex As Exception
sheet.Cells(3, "I") = ex.Message
sheet.Cells(4, "J") = ex.StackTrace
sheet.Cells(5, "K") = ex.TargetSite
End Try

        WeatherXML.LoadXml(weatherInfo)

         <code snipped> <- Im still working on parsing the XML String

    End Sub