I've hit what looks a lot like a bug in cffunction/cfargument when invoked as a
web service. I haven't tested this code in a non-webservice environment.
In short, I can produce a "Web service operation "[function name]" with
parameters {[arguments]} could not be found" error by varying the order in
which my arguments appear when an argument of type="numeric" is included.
here is my invoke call:
<cfinvoke
webservice="webserviceURL"
method="argumenttest"
numericarg = 10
numeric2arg = 11
string2arg = "hello"
stringarg = "hi"
returnvariable="successp">
</cfinvoke>
And here is the cffunction, invoked as the above webservice:
<cffunction name="argumenttest" access="remote" returntype="boolean"
output="no">
<cfargument name="numericarg" type="numeric" required="yes">
<cfargument name="numeric2arg" type="numeric" required="yes">
<cfargument name="stringarg" type="string" required="yes">
<cfargument name="string2arg" type="string" required="yes">
<cfreturn true>
</cffunction>
I can change the order of the arguments in the <cfinvoke> call until I'm blue
in the face, and everything works fine.
However, if I change the order of the arguments in the <cffunction> call, I can
get the error message I indicated above. Yes, I am refreshing the web service
after each change.
This breaks:
<cffunction name="argumenttest" access="remote" returntype="boolean"
output="no">
<cfargument name="numericarg" type="numeric" required="yes">
<cfargument name="stringarg" type="string" required="yes">
<cfargument name="string2arg" type="string" required="yes">
<cfargument name="numeric2arg" type="numeric" required="yes">
<cfreturn true>
</cffunction>
This breaks:
<cffunction name="argumenttest" access="remote" returntype="boolean"
output="no">
<cfargument name="stringarg" type="string" required="yes">
<cfargument name="string2arg" type="string" required="yes">
<cfargument name="numeric2arg" type="numeric" required="yes">
<cfargument name="numericarg" type="numeric" required="yes">
<cfreturn true>
</cffunction>
This breaks:
<cffunction name="argumenttest" access="remote" returntype="boolean"
output="no">
<cfargument name="numeric2arg" type="numeric" required="yes">
<cfargument name="stringarg" type="string" required="yes">
<cfargument name="numericarg" type="numeric" required="yes">
<cfargument name="string2arg" type="string" required="yes">
<cfreturn true>
</cffunction>
So, in short, as long as the numeric arguments are listed *first* everything
works. As soon as they aren't, the web service "can't be found".
Other interesting notes:
1. If there is only 1 numeric argument, my experience is even stranger. Just
now, I wasn't able to get the web service to function properly at all. Yet, I
have another web service that does have a single numeric incident which does
work. In that case, the argument is listed last.
2. I can have any number of arguments if they are of type "string"
3. It doesn't seem to matter if I pass the arguments in as I have shown above,
or with the argumentcollection parameter, or with the <cfinvokeargument> tag.
4. If I add in a type="boolean" argument, then the following appears to be
true:
a) I can have 1 numeric argument
b) the numeric argument can be listed first
c) the numeric argument can be listed second *as long as* the boolean argument
is listed first
d) any other argument ordering will produce the above error
So, I see four possibilities:
1. I've lost my mind
2. This is a genuine bug
3. The refresh feature of the CF Administrator doesn't work under some
circumstances
4. Arguments must be listed in a particular order that I just don't know about.
Any help is appreciated.
Thanks in advance,
Ben Mueller
Sr. Software Engineer
Cognitive Arts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:205169
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54