2010-11-16 84 views
2

我试图从冷聚变中使用.NET Web服务。简单类型的方法工作正常。但我有一个接受byte []数组作为输入的特定方法的问题。Web服务错误:无法找到参数操作

下面的示例中的WebMethod声明

[WebMethod] 
    public AVStatus ScanStream(byte[] fileObject) 
    { 
       // code 
    } 

和冷聚变代码消费这项服务是

<cffile action="readBinary" file="#FileName#" variable="filedata"> 
    <cfset b64file = #toBase64(filedata)#> 
    <cfinvoke webservice = "http://xxx/scanservice.asmx?wsdl" 
     method = "ScanStream"  
     returnVariable = "result"> 
      <cfinvokeargument name="fileObject" value="#b64file#" /> 

    </cfinvoke> 

这总是导致这个错误Web服务操作ScanStream与参数无法找到

有人可以帮我解决这个问题吗?

回答

2

看来,二进制数据已经被公开为在ColdFusion bas64串而byte[]由服务公开为XML阵列(字节)。

更改ScanStream(如果可以)接受字符串,如果Web服务不是您的,您可以说服所有者提供另一种接受字符串的方法,并使用Convert.FromBase64String更改为字节数组。

+0

感谢哥们...那就是确切的问题.... :) – RameshVel 2010-11-17 05:39:26

+0

太棒了!乐于帮助。 – Aliostad 2010-11-17 08:57:14

0

Webservices是远程的,不公开的。公开允许其他CF类和页面访问。将public改为remote,你应该能够“看到”你的webservice。

相关问题