Consuming ColdFusion webservice - Web service operation with parameters {} cannot be found
coldfusion, web-services
Solution
Try adding the `refreshWSDL` argument to your `<cfinvoke>` call and see if that helps.
<cfinvoke
webservice="http://127.0.0.1/books.cfc?wsdl"
method="listBooks"
refreshwsdl="yes"
returnvariable="rawXMLBookList">
</cfinvoke>
Setting `refreshwsdl="yes"` reloads the WSDL file and regenerates the artifacts used to consume the web service.
Note you do not want to keep this setting for all of your requests. You just need to set it for one request to refresh the artifacts. Then you should change it back to `refreshwsdl="no"`. Until you need it again.
Here is an excerpt from Charlie Arehart's Blog about the `refreshWSDL` argument:
Why should you have to refresh the web service metadata?
Just to back up for a moment, the problem stems from CF's attempt to help. On the first request for a given web service, CF does some caching to make future requests go faster, not caching the results of the web service method but rather the artifacts used by CF based on the description of the web service itself.
CF uses the web service description (WSDL) reported at the time of that first call to create a java proxy/stub based on that, which it then reuses on future calls from CF to that web service.
The issue arises if/when the web service metadata changes. CF won't know, and will continue to use the older cached proxy/stub, and your long-running code may fail if it doesn't match the new WSDL returned by the web service.
So we need a way to tell CF to refresh its cache of that proxy stub.
This new feature is certainly the easiest way to make that happen, but it's not the only way.
Problem
I am testing consuming a web-service and I'm getting an error. Here is the web-service component: ``` <cfcomponent > <cffunction name="listBooks" access="remote" returntype="string" output="no" > <cfquery name="getBooks" datasource="cfbookclub" > SELECT bookID, title, bookDescription, genre FROM books ORDER BY title desc </cfquery> <cfsavecontent variable="bookList" > <books> <cfoutput query="getBooks" > <book id="#getBooks.bookID#" > <title>#XMLFormat( getBooks.title )#</title> <description>#XMLFormat( getBooks.bookDescription )#</description> <genre>#XMLFormat( getBooks.genre )#</genre> </book> </cfoutput> </books> </cfsavecontent> <cfreturn bookList > </cffunction> ``` Here is the consuming page: ``` <cfinvoke webservice="http://127.0.0.1/books.cfc?wsdl" method="listBooks" returnvariable="rawXMLBookList" > </cfinvoke> ``` Seems simple enough - I was actually trying to pass an argument "genre" when I got the initial error, ``` Web service parameter name category cannot be found in the provided parameters {genre}. ``` So I removed all reference to arguments, and STILL get this error ``` Web service operation with parameters {} cannot be found. ``` The error makes it sound like the web-service cannot be found, however if I cut and paste the url into my browser I get the expected XML doc... There was another post like this on this site, but the problem was a base64 issue, I'm just returning txt so I don't think it's a similar problem, even through the error msg is similar.