nws网络服务问题 [英] nws webservice issue
本文介绍了nws网络服务问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我在尝试从国家气象局获取天气预报时遇到问题.
我正在使用VS2010.新的控制台应用程序并添加了http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl并将其重命名为gov.weather
这是我的代码
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)
我遇到一个错误,指出从字符串时间序列"到类型"Integer"的转换无效."
I have an error stating "Conversion from string "time-series" to type ''Integer'' is not valid."
推荐答案
产品类型是其自己的类,而不是字符串.
更改您的代码,使其看起来像这样,我认为它应该可以工作.我在VS2008中检查了代码,但我想它在VS2010中类似.
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.
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)
这篇关于nws网络服务问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文