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.

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

报告相同问题?

悬赏问题

  • ¥50 怎么判断同步时序逻辑电路和异步时序逻辑电路
  • ¥15 差动电流二次谐波的含量Matlab计算
  • ¥15 Can/caned 总线错误问题,错误显示控制器要发1,结果总线检测到0
  • ¥15 C#如何调用串口数据
  • ¥15 MATLAB与单片机串口通信
  • ¥15 L76k模块的GPS的使用
  • ¥15 请帮我看一看数电项目如何设计
  • ¥23 (标签-bug|关键词-密码错误加密)
  • ¥66 比特币地址如何生成taproot地址
  • ¥20 数学建模数学建模需要