Home arrow ColdFusion arrow Page 2 - Creating a Web Service with ColdFusion: the Basics

Creating a Web Service with ColdFusion: the Basics

A web service is a software related technology that facilitates machine-to-machine interaction over a network. Web services are used by clients who access the service, and could be written in any programming language. This article will show you how to create a web service using ColdFusion.

Author Info:
By: Jayaram Krishnaswamy
Rating: 5 stars5 stars5 stars5 stars5 stars / 36
February 21, 2006
  1. · Creating a Web Service with ColdFusion: the Basics
  2. · Create a Function
  3. · Turn the function into a Web Service
  4. · Consuming the Service

print this article

Creating a Web Service with ColdFusion: the Basics - Create a Function
(Page 2 of 4 )

Create function justFunction.cfm

I will show how to create a function. Of course you need to know all those tags. But this next code shows a very simple function which outputs a string after accepting a different string. This file is called justFunction.cfm. The function is called by its name. The argument is sent through the vehicle "arguments. name" which is "Jay" in this case.

<cffunction name="WelcomeMsg"  returntype="string">
<cfargument name="name" type="string" required="yes">
<cfreturn "<h3><font color='blue'>Welcome to my Web Service Site</font>
</h3> " & arguments. name &"! " & "What would you like to do?">
</cffunction> <cfoutput> #WelcomeMsg("Jay")# </cfoutput>

justFunction.cfm display

You need to place this file into the TestingCF virtual directory (which means in the physical directory shown earlier). Now if you browse this file in your favorite browser, this is what you will see.

blog comments powered by Disqus

- Adobe ColdFusion Just Got More RAD
- How to Access a SQL Anywhere Database with C...
- CFXML: Probing XMLDOM in ColdFusion
- Creating a Web Service with ColdFusion: the ...
- CFAjax: What it is and How to Use it
- Querying SQL 2000 Server from ColdFusion
- Introduction to ColdFusion Markup Language, ...
- Introduction to ColdFusion Markup Language
- Databases and Dreamweaver MX 2004, concluded
- Databases and Dreamweaver MX 2004
- Welcome to Coldfusion MX 6.1, concluded
- Welcome to Coldfusion MX 6.1
- What You Must Know About ColdFusion Flow-Con...
- What You Must Know About Operators in ColdFu...
- Everything You Must Know About ColdFusion Va...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials