RameshVel
RameshVel

Reputation: 65877

web service error: operation with parameters cannot be found

I am trying to consume the .net webservice from cold fusion. Methods having simple types working fine. But i am having problems with one particular method which accepts byte[] array as input.

Below the sample webmethod declaration

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

and the cold fusion code consuming this service is

   <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>

This always leads to this error Web service operation ScanStream with parameters cannot be found.

can someone help me out this?

Upvotes: 2

Views: 697

Answers (2)

Ben Doom
Ben Doom

Reputation: 7885

Webservices are remote, not public. Public allows access by other CF classes and pages. Change public to remote, and you should be able to "see" your webservice.

Upvotes: 0

Aliostad
Aliostad

Reputation: 81700

It seems that the binary data has been exposed as bas64 string in the coldfusion while byte[] is exposed by the service as an XML array (of bytes).

Change the ScanStream (if you can) to accept a string, if web service is not yours you could convince owners to provide another method which accepts string and uses Convert.FromBase64String to change to byte array.

Upvotes: 2

Related Questions