<cfcomponent>
<cffunction name="myFunction" returntype="string" output="no">
<cfargument name="myArgument" type="string" required="yes">
<cfset myResult="Welcome Srikanth">
<cfreturn myResult>
</cffunction>
</cfcomponent>
<cffunction name="myFunction" returntype="string" output="no">
<!--- requires a string --->
<cfargument name="myArgument" type="string" required="yes">
<cfset myResult=myArgument>
<!--- returns the same string --->
<cfreturn myResult>
</cffunction>
<cfoutput>
#myFunction("Hi How are you")#
</cfoutput>
<cfcomponent>
<cffunction name="myFunction" returntype="string" output="no">
<!--- requires a string --->
<cfargument name="myArgument" type="string" required="yes">
<cfset myResult=myArgument>
<!--- returns the same string --->
<cfreturn myResult>
</cffunction>
</cfcomponent>
<!--- ... --->
<cffunction name="myFunction" access="remote" returntype="string">
<!--- ... --->
<cfinvoke
webservice="http://localhost/path/to/your.cfc?wsdl"
method="MyFunction"
returnvariable="myResults">
<cfinvokeargument name="myArgument" value="HI Srikanth"/>
</cfinvoke>
<cfoutput>
#myResults#
</cfoutput>
<cfscript>
myWebservice = CreateObject("webservice", "http://localhost/path/to/your.cfc?wsdl");
results = myWebservice.MyFunction(myArgument="HI Srikanth");
</cfscript>
<cfoutput>#results#</cfoutput>
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)