Created
April 2, 2013 14:24
-
-
Save youcoldfusion/5292599 to your computer and use it in GitHub Desktop.
ColdFusion Webservice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- | |
<cfinvoke component="testWebservice" method="getUser" returnvariable="display"> | |
<cfinvokeargument name="username" value="Animesh Dutta"> | |
</cfinvoke> | |
<cfdump var="#display#"> | |
---> | |
<!---<cfinvoke method="getUser" webservice="http://YOURURL/testWebservice.cfc?wsdl" returnvariable="display"> | |
<cfinvokeargument name="username" value="Animesh Dutta"> | |
</cfinvoke>---> | |
<cfset ws=createObject("webservice","http://YOURURL/testWebservice.cfc?wsdl")> | |
<cfset display=ws.getUser("Animesh Dutta")> | |
<cfdump var="#display#"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!---For creating web services the function access type must be remote ---> | |
<cfcomponent displayname="testWebservice" output="false"> | |
<cffunction name="getUser" access="remote" returntype="string"> | |
<cfargument name="username" type="string" required="true" /> | |
<cfset var welcomeMessage=arguments.username> | |
<cfreturn "welcome to " &" "& welcomeMessage & "'s" & " " & "webservic"/> | |
</cffunction> | |
</cfcomponent> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment