如何修复“faultString:[Virtuoso SOAP服务器]没有这样的程序”Webservice cfinvoke CF11?

时间:2016-07-07 18:20:40

标签: web-services soap coldfusion coldfusion-11

使用ColdFusion 11调用带有<cfinvoke>标记的Web服务时出现以下错误。

  

faultString:[Virtuoso SOAP服务器]没有这样的程序

我已经将所有正确的参数传递给方法(尊重参数名称的情况)。

致电代码

<cfinvoke Webservice="absolute link" method="method name" wsversion="1" refreshwsdl="true">
    <cfinvokeargument name="paramone" value="valone">
    <cfinvokeargument name="paramtwo" value="valtwo">
</cfinvoke>

提前感谢您的帮助。

1 个答案:

答案 0 :(得分:2)

我找到了解决方案。出于某些原因,使用cfinvoke标记不能用于使用他们的Web服务。

我已经使用cfhttp标记作为替代,并添加了一个名为“SOAPAction”的头参数,并将其设置为一个我无法在此分享的特定值。此外,action属性需要设置为“POST”。

最终的解决方法代码如下(其中wsRequest变量是要发送的xml):

<cfhttp method="post" url="#application.WSDLEndpoint#">
    <cfhttpparam type="header" name="content-type" value="text/xml"> 
    <cfhttpparam type="header" name="SOAPAction" value="[specific absolute link]"> 
    <cfhttpparam type="header" name="charset" value="utf-8"> 
    <cfhttpparam type="xml" value="#wsRequest#" >
</cfhttp>