Copy link to clipboard
Copied
I have two webservices with the same code but with different names
<cffunction name="getUserNameFormField" access="remote" output="false" returntype="string" displayname="getUserNameFormField">
<cfset var return = '<input name="userName" type="text" size="40" maxlength="40">'>
<cfreturn return>
</cffunction>
<cffunction name="getUserNameFormFieldn" access="remote" output="false" returntype="string" displayname="getUserNameFormFieldn">
<cfset var return = '<input name="userName" type="text" size="40" maxlength="40">'>
<cfreturn return>
</cffunction>
But when I invoke the first one return a check box.
For the second service displays an error as such? Can any one explain me a reason behind it?
Her is the invocation code and the error
<html>
<body>
<cfcomponent>
<cfinvoke
webservice="http://localhost:8080/CTiWebServicesAPI/console/library/BaseConsole.cfc?wsdl"
method="getUserNameFormFieldn"returnvariable="saleshistory"
>
<!--- <cfinvokeargument name="requestedEvent" value="recipientForm"/>--->
</cfinvoke>
<cfoutput>
#saleshistory#</cfoutput>
</cfcomponent>
</body>
</html>
The web site you are accessing has experienced an unexpected error.
Please contact the website administrator.
The following information is meant for the website developer for debugging purposes. | ||||||||||||||||||||||||
Error Occurred While Processing Request | ||||||||||||||||||||||||
|
Copy link to clipboard
Copied
The first thing to try is to refresh the web-service. The first time a web-service is invoked a 'stub' (I beleive it is called) of it is created that indicates that name and return type of the methods AKA functions and the names and types of the parameters the function expects to be passed in. If, after this first invocation, this function 'profile' is changed by adding or removing or renaming functions and|or adding or removing or renaming arguments then this error is common.
The brute foruce but often quikest way to refresh the web-service is do delete it from the web service section of the ColdFusion administrator. There are other ways to do it as well.
HTH
Ian
Message was edited by: Ian Skinner
Copy link to clipboard
Copied
There are two methods, but it is one web service, not two. The code you should have saved as the file BaseConsole.cfc is
<cfcomponent>
</cfcomponent>
There is no need for HTML or component tags in the caller. The calling page, say, wsCaller.cfm, should be something like
<cfinvoke
webservice= "http://localhost:8080/CTiWebServicesAPI/console/library/BaseConsole.cfc?wsdl"
method="getUserNameFormFieldn"
returnvariable="saleshistory">
</cfinvoke>
<cfoutput>#saleshistory#</cfoutput>
<cffunction name="getUserNameFormField" access="remote" output="false" returntype="string" displayname="getUserNameFormField">
<cfset var return = '<input name="userName" type="text" size="40" maxlength="40">'>
<cfreturn return>
</cffunction>
<cffunction name="getUserNameFormFieldn" access="remote" output="false" returntype="string" displayname="getUserNameFormFieldn">
<cfset var return = '<input name="userName" type="text" size="40" maxlength="40">'>
<cfreturn return>
</cffunction>
Copy link to clipboard
Copied
I take it for granted you have verified the wsdl is good, by making sure you can see it when you open its url in the browser.
Copy link to clipboard
Copied
What a mix-up. My earlier post -- which I can't edit because it misses the edit button -- should have read:
There are two methods, but it is one web service, not two. The code you should have saved as the file BaseConsole.cfc is
<cfcomponent>
<cffunction name="getUserNameFormField" access="remote" output="false" returntype="string" displayname="getUserNameFormField">
<cfset var return = '<input name="userName" type="text" size="40" maxlength="40">'>
<cfreturn return>
</cffunction>
<cffunction name="getUserNameFormFieldn" access="remote" output="false" returntype="string" displayname="getUserNameFormFieldn">
<cfset var return = '<input name="userName" type="text" size="40" maxlength="40">'>
<cfreturn return>
</cffunction>
</cfcomponent>
There is no need for HTML or component tags in the caller. The calling page, say, wsCaller.cfm, should be something like
<cfinvoke
webservice= "http://localhost:8080/CTiWebServicesAPI/console/library/BaseConsole.cfc?wsdl"
method="getUserNameFormFieldn"
returnvariable="saleshistory">
</cfinvoke>
<cfoutput>#saleshistory#</cfoutput>