Adobe COLDFUSION 9 Manual page 1349

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
<cfcomponent>
<cffunction name="echo" output="No" returntype="string">
<cfargument name="echoString" required="Yes">
<cfreturn "echo: #arguments[1]#">
</cffunction>
<cffunction name="getArtists" returntype="query" hint="query the database and return the
results.">
<cfquery name="artists" datasource="cfcodeexplorer">
select *
from artists
</cfquery>
<cfreturn artists>
</cffunction>
</cfcomponent>
Managing web services
The Services Browser lets you manage a list of web services by adding or deleting WSDL URLs from a list. In addition,
when you are editing a ColdFusion file, you can use the Services Browser to generate CFML code to invoke a web
service or to create a web service object. Similarly, when you are editing an ActionScript file, you can use the Services
Browser to generate ActionScript.
To view the list of web services, click the Show Web Services button in the top right corner of the Services Browser view.
Add a web service to the list
Right-click in the Services Browser view.
1
2
Select Add WSDL.
Enter a valid WSDL URL.
3
Click OK.
4
Delete a web service from the list
1
Right-click in the Services Browser view.
Select Delete WSDL.
2
Invoke a web service in ColdFusion
1
Place your mouse pointer where you want to insert the code.
View the list of web services.
2
Highlight a web service or a method in a web service and right-click.
3
4
Select Insert CFInvoke.
The code that the Service Browser generates appears in the ColdFusion file. The following is an example of the code
that the Service Browser generates:
<cfinvoke
webservice="http://arcweb.esri.com/services/v2/MapImage.wsdl"
method="convertMapCoordToPixelCoord"
returnVariable="convertMapCoordToPixelCoord" >
<cfinvokeargument name="mapCoord" type="" />
<cfinvokeargument name="viewExtent" type="" />
<cfinvokeargument name="mapImageSize" type="" />
</cfinvoke>
Last updated 8/5/2010
1344

Advertisement

Table of Contents
loading

Table of Contents