
222
Chapter 11: Building and Using ColdFusion Components
Creating web services
ColdFusion MX can automatically publish CFC methods as web services. To publish a CFC
method as a web service, you specify the
access="remote"
attribute in the method’s
cffunction
tag. ColdFusion generates all the required Web Services Description Language (WSDL) code and
exports the CFC methods. For more information on creating web services in ColdFusion, see
Chapter 32, “Using Web Services,” on page 707
.
Creating Macromedia Flash Remoting elements
Flash applications that use Flash Remoting MX can access CFC methods by using the CFC path
as the service name in a NetServices
gatewayConnection.getService
method. Then you call
the CFC methods by appending the method name to the service name, as the following example
shows:
gatewayConnection = NetServices.createGatewayConnection();
myServiceObject = gatewayConnection.getService("myService", this);
myServiceOjbect.myFunction( { dept: Sales, name: BobZ });
For more information on creating CFCs for Flash Remoting MX, see
“Using Flash with
ColdFusion components” on page 646
.
Calling CFC methods using a URL or form
Clients can directly call CFC methods using a URL or by submitting form fields. In these cases
the CFC method is responsible for generating all HTML that is returned to the client.
ColdFusion component features and use
This section describes the elements and features of CFCs. It indicates how CFCs embody the
concepts described in the
“Basic component concepts”
section. It introduces, but does not
describe in detail, how to use these elements in a ColdFusion application.
Tags and functions for creating and using CFCs
The following table lists the required tags and functions that you use to create or use CFCs. It also
lists the tags and functions that contain CFC-specific functionality.
Tag or function
Description
cfcomponent
Contains a component definition; includes attributes for introspection
cffunction
Defines a component method (function); includes attributes for
introspection
cfargument
Defines a parameter (argument) to a method; includes attributes for
introspection
cfproperty
Defines variables for CFCs that provide web services; can also be used to
document component properties
cfinvoke
Invokes a method of a CFC
cfinvokeargument
Passes the name and value of a parameter to a component method
cfobject
Creates a CFC instance
CreateObject
Creates a CFC instance
GetMetaData
Returns the metadata of a CFC
Summary of Contents for COLDFUSION MX 61-DEVELOPING COLDFUSION MX
Page 1: ...Developing ColdFusion MX Applications...
Page 22: ...22 Contents...
Page 38: ......
Page 52: ...52 Chapter 2 Elements of CFML...
Page 162: ......
Page 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Page 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Page 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Page 266: ......
Page 314: ...314 Chapter 14 Handling Errors...
Page 344: ...344 Chapter 15 Using Persistent Data and Locking...
Page 349: ...About user security 349...
Page 357: ...Security scenarios 357...
Page 370: ...370 Chapter 16 Securing Applications...
Page 388: ...388 Chapter 17 Developing Globalized Applications...
Page 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Page 410: ......
Page 426: ...426 Chapter 19 Introduction to Databases and SQL...
Page 476: ...476 Chapter 22 Using Query of Queries...
Page 534: ...534 Chapter 24 Building a Search Interface...
Page 556: ...556 Chapter 25 Using Verity Search Expressions...
Page 558: ......
Page 582: ...582 Chapter 26 Retrieving and Formatting Data...
Page 668: ......
Page 734: ...734 Chapter 32 Using Web Services...
Page 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Page 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Page 788: ......