Using Web Services - Adobe 38043740 - ColdFusion Standard - Mac Development Manual

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using Web Elements and External Objects
<!--- Enable client state management --->
<cfapplication name="relatives" clientmanagement="Yes">
<!--- Build a complex data structure --->
<cfscript>
relatives = structNew();
relatives.father = "Bob";
relatives.mother = "Mary";
relatives.sisters = arrayNew(1);
arrayAppend(relatives.sisters, "Joan");
relatives.brothers = arrayNew(1);
arrayAppend(relatives.brothers, "Tom");
arrayAppend(relatives.brothers, "Jesse");
</cfscript>
A dump of the original relatives structure:<br>
<br>
<cfdump var="#relatives#"><br>
<br>
<!--- Convert data structure to string form and save it in the client scope --->
<cfwddx action="cfml2wddx" input="#relatives#" output="Client.wddxRelatives">
The contents of the Client.wddxRelatives variable:<br>
<cfoutput>#HtmlEditFormat(Client.wddxRelatives)#</cfoutput><br>
<!--- Now read the data from client scope into a structure --->
<cfwddx action="wddx2cfml" input="#Client.wddxRelatives#" output="sameRelatives">
<br>
A dump of the sameRelatives structure generated from client.wddxRelatives<br>
<cfdump var="#sameRelatives#">

Using Web Services

Web services let you publish and consume remote application functionality over the Internet. When you consume web
services, you access remote functionality to perform an application task. When you publish a web service, you let
remote users access your application functionality to build it into their own applications.
Web services
Since its inception, the Internet has allowed people to access content stored on remote computers. This content can be
static, such as a document represented by an HTML file, or dynamic, such as content returned from a ColdFusion page
or CGI script.
Web services let you access application functionality that someone created and made available on a remote computer.
With a web service, you can make a request to the remote application to perform an action.
For example, you can request a stock quote, pass a text string for translation, or request information from a product
catalog. The advantage of web services is that you do not have to re-create application logic that someone else has
already created and, therefore, you can build your applications faster.
Last updated 1/20/2012
1093

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents