doq91130 2011-02-22 16:51
浏览 51
已采纳

从weather.gov运行示例Web服务代码时出错

I'm trying to integrate weather data from the NOAA in my web site, and as a starting point I was trying to run their sample code (available here. The specific sample I'm trying to work with is the Basic Client sample (starting point is ndfdXML.htm).

I've followed the readme instructions for downloading nuSOAP and changing location to local paths, and changing the location of soapclient to www.weather.gov instead of localhost, but I'm still getting an error when I actually submit the page.

The error only shows up when I do a view-source, and this is what it says:

Fatal error:  Uncaught SoapFault exception: 
[WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php': 
Extra content at the end of the document  in /opt/lampp/htdocs/weather/ndfdXMLclient.php:179

Stack trace:
#0 /opt/lampp/htdocs/weather/ndfdXMLclient.php(179): SoapClient->SoapClient('http://www.weat...')
#1 {main}   thrown in /opt/lampp/htdocs/weather/ndfdXMLclient.php on line 179

Any idea what this means? I've been unable to find any kind of help offered by the actual weather service.

  • 写回答

1条回答 默认 最新

  • doubu1853 2011-02-22 17:04
    关注

    I bet you need to put the actual path to the wsdl in your SoapClient code.

    http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php?wsdl

    (note the "?wsdl" at the end)

    It looks like your code is trying to create the SoapClient using http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php as the path for the wsdl. If you actually go there, you can see that this isn't the wsdl. It is actually located at the first url in this post.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

    报告相同问题?

    悬赏问题

    • ¥15 stm32f103zet6 串口5无法收发数据
    • ¥15 关于C语言使用线程队列实现多线程并发
    • ¥15 这个运行,错误在哪里呀,大家看看吧,教导我
    • ¥15 advanceinstaller对话框设置
    • ¥100 正常上网,内部网页无法打开
    • ¥15 组件库引入并使用在若依框架未展示
    • ¥149 关于#使用python 的Flash Echarts+ajax+mysql动态数据实现饼图#的问题,请各位专家解答!
    • ¥15 RichTextBox中追加文本时报错
    • ¥15 关于c语言的学习问题
    • ¥15 activity升级到flowable工作流act_ge_bytearray的草稿json数据复制到act_de_model 的model_editor_json的脚本