panel, select the CF Components option from the Components Type menu. 5. Click the Add Component (+) button. The Create Component dialog appears. 6. In the Name text box in the Component section, enter the value CompanyEvents. Browse to the C:\Inetpub\wwwroot\DorknozzleCFM\cfc folder in the Component Directory File field. The result appears similar to Figure 30.19. Figure 30.19. Give your component a name and a directory to save to. [View full size image] 7. Switch to the Functions section. Click the Add Function (+) button to create a new function. Assign the value getCompanyEvents in the Name text box, select the remote option from the Access menu, and choose the query option from the Return Type menu. The results appear similar to Figure 30.20. Figure 30.20. Give your function a name, an Access type, and a Return type. [View full size image] 8. Click OK. The dialog closes and the CompanyEvents.cfc file opens complete with the necessary code to get you started (see Figure 30.21). Figure 30.21. The new CompanyEvents.cfc file opens complete with the necessary code to get you started. [View full size image] 9. Switch to the Bindings panel and select the Recordset option from the Add (+) menu. The Recordset dialog appears. 10. Enter the name rsCE in the Name text box. 11. Make sure that the getCompanyEvents function is selected from the Function menu. 12. Choose the connDorknozzle option from the Data Source menu. 13. Choose the x_CompanyEvents option from the Table menu. 14. Click the Selected radio button from the Columns radio button group and highlight only the Event, Date, and Location fields. 15. Click OK. Again, the necessary code is added to the CompanyEvents.cfc file similar to Figure 30.22. Figure 30.22. The appropriate code is added to the CompanyEvents.cfc file. [View full size image] You're done! You've successfully created a ColdFusion web service. In the next section, we'll review the process of consuming the web service using a ColdFusion web application. Consuming the Company Events Web Service in ColdFusion With the web service created, you're now ready to add the code to the web application that will consume the data the web service exposes. To add this functionality, follow these steps: 1. Open the index.cfm page if it's not already open. 2. Select the existing company events table and delete it. 3. With your cursor still highlighted in the cell, switch to Code view and add the following code: <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td>Event</td> <td>Date</td> <td>Location</td> </tr> <cfoutput query="aQuery"> <tr>