Services Browser



The ColdFusion Services Browser lets you view all of the CFCs and web services on your computer.

Use the Services Browser

  1. In Flash Builder or Eclipse, select Window > Show View > Other.

  2. Select ColdFusion > Services Browser.

The Services Browser can do the following:

  • Browse components

  • Manage web services

Browsing components

The Service Browser lists the following components:

  • Components that the ColdFusion component browser lists

    The ColdFusion component browser is located at cf_root/wwwroot/CFIDE/componentutils/componentdoc.cfm.

  • Components that are located in any directories specified in the ColdFusion Administrator Mappings page

  • Components that are located in any directories specified in the ColdFusion Administrator Custom Tag paths page

You can restrict the list of CFCs according to whether the functions in a CFC are remote, public, or private.

A sample element of the list appears as follows:

The first line of the listing contains the path. The second line includes the name of the CFC. The next two lines contain the names of the functions in the CFC. The function name is followed by any argument, a colon, then the type of the return value. The listing echo(echoString):STRING indicates that the echo function has an argument named echoString, and that it returns a string. The myCFC CFC appears as follows:

<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

  1. Right-click in the Services Browser view.

  2. Select Add WSDL.

  3. Enter a valid WSDL URL.

  4. Click OK.

Delete a web service from the list

  1. Right-click in the Services Browser view.

  2. Select Delete WSDL.

Invoke a web service in ColdFusion

  1. Place your mouse pointer where you want to insert the code.

  2. View the list of web services.

  3. Highlight a web service or a method in a web service and right-click.

  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>

Create a web service object in ColdFusion

  1. Place your mouse pointer where you want to insert the code.

  2. View the list of web services.

  3. Highlight a web service or a method in a web service and right-click.

  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:

createObject("webservice", "http://arcweb.esri.com/services/v2/MapImage.wsdl").convertMapCoordToPixelCoord(mapCoord, viewExtent, mapImageSize);