User Guide

Table Of Contents
Moving complex data across the web with WDDX 875
Moving complex data across the web with WDDX
WDDX is an XML vocabulary for describing a complex data structure, such as an array,
associative array (such as a ColdFusion structure), or a recordset, in a generic fashion. It lets you
use HTTP to move the data between different application server platforms and between
application servers and browsers. Target platforms for WDDX include ColdFusion, Active Server
Pages (ASP), JavaScript, Perl, Java, Python, COM, Macromedia Flash, and PHP.
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 22K.
Unlike traditional client-server approaches, the source and target system can have minimal-to-
no prior knowledge of each other. They only need to 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 a number of 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.