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.

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

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料