【发布时间】:2014-06-18 09:36:42
【问题描述】:
所以我对 SOAP 非常陌生,我正在尝试连接到国家气象局的 SOAP 服务,以便提取预测数据以显示在我的网页上。这是我对这个过程的简短代码:
<cfinvoke
webservice="http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl"
method="NDFDgen"
returnvariable="aTemp">
<cfinvokeargument name="latitude" value="37.94"></cfinvokeargument>
<cfinvokeargument name="longitude" value="-75.47"></cfinvokeargument>
<cfinvokeargument name="product" value='"glance"'></cfinvokeargument>
<cfinvokeargument name="startTime" value="2014-05-02T12:00"></cfinvokeargument>
<cfinvokeargument name="endTime" value="2014-05-05T12:00"></cfinvokeargument>
<cfinvokeargument name="Unit" value='"e"'></cfinvokeargument>
<cfinvokeargument name="weatherParameters" value="maxt = TRUE"></cfinvokeargument>
</cfinvoke>
问题是,当我尝试运行我的网页时,我收到以下错误:
Web service operation NDFDgen with parameters {Unit={"e"},startTime={2014-05-02T12:00},endTime={2014-05-05T12:00},product={"glance"},longitude={-75.47},weatherParameters={maxt = TRUE},latitude={37.94}} cannot be found.
我有点困惑,因为 NDFDgen 操作确实存在于我正在检索的 WSDL 文件中,并且我已经解决了 NDFDgen 操作所需的所有参数。
链接到我正在尝试使用的 WSDL 文件: http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl
链接到所需参数的功能页面: http://graphical.weather.gov/xml/#use_it
有人能看出我的代码有什么问题吗?我传递给 SOAP 的论点是否可能与我的论点有关?我什至尝试遵循这个 Stack Overflow 问题 (Consuming ColdFusion webservice - Web service operation with parameters {} cannot be found) 的建议并添加了
refreshwsdl="yes"
归因于我的<cfinvoke>,但我仍然遇到同样的错误。
【问题讨论】:
-
这可能会对您有所帮助:forums.adobe.com/message/3189949。它基本上说您必须构建 SOAP 消息,然后通过 CFHTTP 发送它,这也是我对 SOAP Web 服务所做的。我相信只有 CFC 生成的 web 服务可以使用 CFINVOKE,但是我在任何地方都找不到。
-
谢谢,我会试一试的。
标签: web-services soap coldfusion wsdl