以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 关于调用webservice的问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=59263) |
||||
-- 作者:jialihaha -- 发布时间:2014/10/31 17:05:00 -- 关于调用webservice的问题 现在我给出一段代码: Dim rqst As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://www.webxml.com.cn/WebServices/WeatherWebService.asmx/getWeatherbyCityName?theCityName=59316") Dim rsps As System.Net.HttpWebResponse = rqst.GetResponse Dim stm As System.IO.Stream = rsps.GetResponseStream() rsps = Nothing rqst = Nothing Dim reader As New System.IO.StreamReader(stm) Dim strXML As String = reader.ReadToEnd stm.Dispose() 在命令窗口执行,500报错,求大神指导,是什么原因导致的,网址是可以打开的,也可以看到xml的内容
|
||||
-- 作者:有点甜 -- 发布时间:2014/10/31 17:06:00 -- 不要www
Dim rqst As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://webxml.com.cn/WebServices/WeatherWebService.asmx/getWeatherbyCityName?theCityName=59316")
Dim rsps As System.Net.HttpWebResponse = rqst.GetResponse
Dim stm As System.IO.Stream = rsps.GetResponseStream()
rsps = Nothing
rqst = Nothing
Dim reader As New System.IO.StreamReader(stm)
Dim strXML As String = reader.ReadToEnd
stm.Dispose() |
||||
-- 作者:jialihaha -- 发布时间:2014/10/31 17:07:00 -- 什么意思? |
||||
-- 作者:jialihaha -- 发布时间:2014/10/31 17:11:00 -- 不行哈,这样得不到要的结果 |
||||
-- 作者:jialihaha -- 发布时间:2014/10/31 17:18:00 -- 求指导 |
||||
-- 作者:有点甜 -- 发布时间:2014/10/31 17:25:00 -- 换种方法
Dim web As New System.Windows.Forms.WebBrowser() output.show(web.Document.Body.InnerText) |
||||
-- 作者:jialihaha -- 发布时间:2014/10/31 17:35:00 -- 搞不定,给你项目帮我弄弄吧,ok?
|
||||
-- 作者:有点甜 -- 发布时间:2014/10/31 17:48:00 --
|