Adobe COLDFUSION 9 Manual page 1090

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using Web Elements and External Objects
The WDDX XML vocabulary consists of a document type definition (DTD) that describes the structure of standard
data types and a set of components for each of the target platforms to do the following:
• Serialize: The data from its native representation into a WDDX XML document or document fragment.
• Deserialize: A WDDX XML document or document fragment into the native data representation, such as a CFML
structure.
This vocabulary creates a way to move data, its associated data types, and descriptors that allow the data to be
manipulated on a target system, between arbitrary application servers.
Note: The WDDX DTD, which includes documentation, is located at
www.openwddx.org/downloads/dtd/wddx_dtd_10.txt.
WDDX is a valuable tool for ColdFusion developers, however, its usefulness is not limited to CFML. If you serialize a
common programming data structure (such as an array, recordset, or structure) into WDDX format, you can use
HTTP to transfer the data across a range of languages and platforms. Also, you can use WDDX to store complex data
in a database, file, or even a client variable.
WDDX has two features that make it useful for transferring data in a web environment:
• It is lightweight. The JavaScript used to serialize and deserialize data, including a debugging function to dump
WDDX data, occupies less than 22 K.
• Unlike traditional client-server approaches, the source and target system can have minimal-to-no prior knowledge
of each other. They only must know the structure of the data that is being transferred.
WDDX was created in 1998, and many applications now expose WDDX capabilities. The best source of information
about WDDX is www.openwddx.org. This site offers free downloads of the WDDX DTD and SDK and additional
resources, including a WDDX FAQ, a developer forum, and links to additional sites that provide WDDX resources.
Uses of WDDX
WDDX is useful for transferring complex data between applications. For example, you can use it to exchange data
between a CFML application and a CGI or PHP application. WDDX is also useful for transferring data between the
server and client-side JavaScript.
Exchanging data across application servers
WDDX is useful for the transfer of complex, structured data seamlessly between different application server platforms.
For example, an application based on ColdFusion at one business could
structure to WDDX. It could then use
The supplier could then deserialize the WDDX to its native data form, the extract information from the order, and pass
it to a shipping company running an application based on ASP.
Transferring data between the server and browser
You can use WDDX for server-to-browser and browser-to-server data exchanges. You can transfer server data to the
browser in WDDX format and convert it to JavaScript objects on the browser. Similarly, your application pages can
serialize JavaScript data generated on the browser into WDDX format and transfer the data to the application server.
You then deserialize the WDDX XML into CFML data on the server.
On the server, you use the
cfwddx
and WddxRecordset JavaScript utility classes to serialize the JavaScript data to WDDX. (ColdFusion installs these
utility classes on your server as webroot/CFIDE/scripts/wddx.js.)
to send the WDDX to a supplier running a CGI-based system.
cfhttp
tag to serialize and deserialize WDDX data. On the browser, you use WddxSerializer
Last updated 8/5/2010
use to convert a purchase order
cfwddx
1085

Advertisement

Table of Contents
loading

Table of Contents