Click here to Skip to main content
15,893,486 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am having an issue trying to get the weather predictions from National Weather Services.

I am using VS2010. New console application and added http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl and renamed it to gov.weather

This is my code

Dim weather As ndfdXMLPortTypeClient = New ndfdXMLPortTypeClient()
Dim soapWeatherParameters As weatherParametersType = New weatherParametersType()

weather.NDFDgen(42.73, -73.99, "time-series", Now, Now.AddDays(5), soapWeatherParameters)


I have an error stating "Conversion from string "time-series" to type 'Integer' is not valid."
Posted
Updated 2-Nov-10 10:24am
v2
Comments
Simon_Whale 2-Nov-10 13:16pm    
your best looking to see if the weather.gov website has a support forum to be honest as without being able to get to any documentation I can't help
HimanshuJoshi 2-Nov-10 16:29pm    
Try http://tech.groups.yahoo.com/group/NDFD_SOAP_Service/ forum. They might be able to help you better

1 solution

The product type is its own class, not a string.

Change your code to look like this and I believe it should work. I checked the code in VS2008, but I would imagine it's similar in VS2010.

VB
Dim weather As ndfdXMLPortTypeClient = New ndfdXMLPortTypeClient()
Dim soapWeatherParameters As weatherParametersType = New weatherParametersType()

weather.NDFDgen(42.73, -73.99, productType.timeseries, Now, Now.AddDays(5), soapWeatherParameters)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900