Whatever message this page gives is out now! Go check it out!

IsWDDX

Last update:
May 18, 2026

Description

Determines whether a value is a well-formed WDDX packet.

Returns

True, if the value is a well-formed WDDX packet; False, otherwise.

Category

Syntax

IsWDDX(value)

See also

Using WDDX in the Developing ColdFusion Applications

History

ColdFusion MX: Changed behavior: if the value parameter is not a WDDX packet, ColdFusion returns False. (In earlier releases, ColdFusion threw an error.)

Parameters

Parameter
Description
value
A WDDX packet

Usage

This function processes a WDDX packet with a validating XML parser, which uses the WDDX Document Type Definition (DTD). To prevent CFWDDX deserialization errors, you can use this function to validate WDDX packets from unknown sources.

Example

 
<!--- serialize a string into a WDDX packet ---> 
<CFWDDX ACTION="CFML2WDDX" INPUT="I am a string!" OUTPUT="MyWDDXPacket1"> 
<cfscript> 
    MyWDDXPacket2 = "I am a string too!" 
    writeOutput(EncodeForHTML(MyWDDXPacket1)) 
    // check if MyWDDXPacket1 contains a well-formed WDDX packet 
    if (IsWDDX(MyWDDXPacket1)){ 
        writeOutput("Well formed WDDX packet") 
    } 
    else { 
        writeOutput("Not a well formed WDDX packet") 
    } 
    // check if MyWDDXPacket2 contains a well-formed WDDX packet 
    writeOutput(EncodeForHTML(MyWDDXPacket2)) 
    if (IsWDDX(MyWDDXPacket2)){ 
        writeOutput("Well formed WDDX packet") 
    } 
    else { 
        writeOutput("Not a well formed WDDX packet") 
    } 
</cfscript>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page