|
ColdFusion Home
Basic ColdFusionIntroductionColdFusion Installation ColdFusion Editors ColdFusion Syntax ColdFusion Includes ColdFusion Variables ColdFusion Variable Types ColdFusion If Statements ColdFusion Loops ColdFusion Datasource ColdFusion Database Queries ColdFusion Lists ColdFusion Arrays ColdFusion Redirect ColdFusion Debugging ColdFusion Error Handling Advanced ColdFusionColdFusion MailColdFusion Functions ColdFusion Components ColdFusion Web Services ColdFusion Upload File ColdFusion Read File ColdFusion Write File ColdFusion Append File ColdFusion Rename File ColdFusion Copy File ColdFusion Move File ColdFusion Delete File Cffile Parameters Using cffile Parameters ColdFusion FTP (cfftp) cfftp Cached Connections ColdFusion HTTP (cfhttp) ColdFusion Query of Queries ColdFusion Charts ColdFusion Summary ColdFusion AdminCF AdministratorCF Archive and Deploy CF Scheduled Tasks CF Mini Tutorial ColdFusion BooksColdFusion MX BibleMacromedia ColdFusion MX 7 Web Application Construction Kit 10GB Webmaster PackageUnique, quality digital content ready to be resold.Includes:
|
ColdFusion Web ServicesYou can make any of your ColdFusion components available to any system you wish over the internet by publishing it as a web service. ColdFusion makes this extremely easy to do. In fact, you only need to add one attribute ( In practice though, you will determine the requirements before creating your web services. Creating ColdFusion Web ServicesHere, I'll try and use a "real life" scenario. Lets say you sell books and you want other companies to be able to advertise your books on their own website (we'll call it the "remote site"). If a user clicks on the ad on the remote site, they are redirected to your website (where you try your hardest to close the sale and direct the user to your shopping cart!) Create the following component and save it as "book.cfc"
The above web service outputs data in XML format so that remote (and potentially non-ColdFusion) systems can read it. This can be acheived by creating a method that retrieves data from a database. It then loops through the recordset using the Testing/calling your ColdFusion Web ServicesYou should test your web services thoroughly before publishing for external consumption.
The above code calls the web service using the URL that the web service is located at. Appended to the URL is wsdl. This tells ColdFusion to generate the WSDL description for the web service. This allows the caller (aka consumer) to interface with the web service. This example uses the Enjoy this website?
Oh, and thank you for supporting Quackit! |
Featured Template:
(Build your websites in minutes!) |