By WinCorp Software, Inc. INFO
[Related Products] [Customers also bought] [All Publisher Products]
Related Products
WDDX2XML Cold Fusion Component (Single Server, open source) v1.0 ($99.95) Cold Fusion Componenet (MX) to convert WDDX packets to to a flatter and less complex XML Packet that is more easily manipulated by the XML Functions built into CFMX or by third party tools. This Open Source version is required to use WDDX2XML CFC as a Web Service or via Flash Remoting.
|
Description
The WDDX2XML Cold Fusion Component (CFC) for Cold Fusion MX (CFMX) will convert your legacy WDDX data packets to a more compact, efficient and readable XML layout easily manipulated by the new XML functionality available in CFMX or third party tools.
With the release of Cold Fusion MX, several new XML Functions and the <CFXML> Tag were added to manipulate XML-formatted data. Though WDDX packets are by definition XML packets, the verbosity and heavy "typing" of WDDX by inserting extra nodes results in large overly-complex packets. Legacy WDDX Data can now be quickly converted to a more traditional XML packet without the extra <var> , <struct>, <string>, etc. nodes for better readability, smaller packet size, and easier manipulation using the new CFMX XML Functions and the <CFXML> Tag.
Example
| WDDX |
Converted by WDDX2XML |
<?xml version="1.0"?>
<wddxPacket version="1.0">
<header>my header</header>
<data>
<struct>
<var name="myObject">
<struct>
<var name="myString">
<string>a string</string>
</var>
<var name="myNumber">
<number>1.23</number>
</var>
</struct>
</var>
</struct>
</data>
</wddxPacket>
|
<?xml version="1.0"?>
<wddx2xml>
<header>my header</header>
<data>
<myObject type="struct">
<myString type="string">a string</myString>
<myNumber type="number">1.23</myNumber>
</myObject>
</data>
</wddx2xml>
|
Note in the example above that datatype information is not lost. Datatype
nodes are converted to "type" attributes.
Visit the WDDX2XML Test Page for a more complex example or to try your own
WDDX packets.
Features
- Converts all WDDX 1.0 Data Types with NO data loss:
- null, boolean, number, dateTime, string, array, struct, recordset, binary
- Cuts "tree" depth in half
- Optional validation of WDDX packets
- Run-time selectable root node name
- Optional indentation of resulting packet for readability
- Returns time (milliseconds) spent converting (it's fast!)
- Verbose error reporting
- WDDX2XML CFC can be called using several methods*:
- cfinvoke
- cfobject
- HTTP GET
- HTTP POST
- CFScript
* Refer to Developing
ColdFusion MX Applications with CFML for alternate methods to invoke CFCs.
Using WDDX2XML CFC as a Web Service or via Flash Remoting requires the Open Source
version of WDDX2XML
Cold Fusion Component (Single Server, Open Source).
ARGUMENTS:
WDDXpacket - (Required) - {string} - the WDDX Packet to be converted
RootNodeName - (Optional) - Default "wddx2xml"
the element name assigned to the root node (replaces "wddxPacket")
ValidateWDDX - (Optional) - Default 0
0 = WDDX Packet is NOT validated for well-formedness, CF Server will generate error
1 = WDDX Packet IS validated for well-formedness prior to conversion
IndentOutput - (Optional) - Default 1
0 = all whitespace-only nodes are stripped (compact packet, fast processing)
all <char code="??"> elements maintain original hexadecimal encoding in format: &#x??;
1 = returned packet is indented for readability
all <char code="??"> elements are encoded using "friendly" character references where possible
(e.g. <char code="3E"> will be converted to >)
RETURNED VALUES:
result - {struct}
result.XMLPacket - {string}|{blank} when result.error > 0
result.proctime - {integer} time in milliseconds to convert packet
result.version - {string} version WDDX2XML CFC used for conversion
result.error - {integer}
0 = No errors
1 = WDDX Packet is not well-formed (ValidateWDDX must be set to 1)
2 = WDDX Parsing error (ValidateWDDX must be set to 1)
3 = Invalid RootNodeName
result.errormsg - {string}
"{blank}" when result.error = 0
"Invalid WDDX Packet" when result.error = 1
"WDDX Packet Parsing Error" when result.error = 2
"Invalid RootNodeName" when result.error = 3
NOTES:
Tested with MSXML3 & MSXML4 transformation engines
Currently only supports UTF-8 Encoding
USAGE:
<cfinvoke component="/{myCFCpath}/WDDX2XML" method="WDDX2XML" returnVariable="result">
<cfinvokeargument name="WDDXpacket" value="#myWDDXPacket#">
<cfinvokeargument name="validateWDDX" value="{0|1}">
<cfinvokeargument name="IndentOutput" value="{0|1}">
<cfinvokeargument name="RootNodeName" value="#myRootName#">
</cfinvoke>
System Requirements
Cold Fusion MX
FREE Demo Purchase of Virtual Software Store Screen Saver
FREE Demo Purchase of Virtual Software Store Screen Saver v1.0 WDDX2XML Cold Fusion Component (Single Server, encrypted) v1.0 WDDX2XML Cold Fusion Component (Single Server, open source) v1.0
|