Solved

when working with a WDDX packet is there a way to loop through the fieldNames

Posted on 2008-10-21
1
790 Views
Last Modified: 2011-09-20
I would like to be able to loop through the fieldnames of a wddx packet and place them into a strcut.  

I use this line to convert it back to cfm <cfwddx action="wddx2cfml" input="#wddxPacket#" output="orders">

So how do I use this to loop through the fieldnames?
<wddxPacket version='1.0'><header/><data><struct><var name='Customer_Addresses'><recordset rowCount='1' fieldNames='STRTABLE,GUIDADDRESSID,GUIDCUSTOMERID,INTADDRESSTYPE,TXTCOMPANYNAME,TXTNAME,TXTADDRESS1,TXTADDRESS2,TXTADDRESS3,TXTCITY,TXTSTATE,TXTZIP,INTCOUNTRYID,TXTPHONE,TXTFAX,TXTEMAIL,DATCREATED' type='coldfusion.sql.QueryTable'>

<field name='STRTABLE'>

<string>Customer_Addresses</string></field><field name='GUIDADDRESSID'><string>1c570882-c506-4b20-8a0b-55c58c5b33ef</string></field><field name='GUIDCUSTOMERID'><string>583d703a-75c9-412f-aaef-fcfac72d095d</string></field><field name='INTADDRESSTYPE'><number>0.0</number></field><field name='TXTCOMPANYNAME'><string></string></field><field name='TXTNAME'><string>michael thompson</string></field><field name='TXTADDRESS1'><string>235 s. bebe</string></field><field name='TXTADDRESS2'><string></string></field><field name='TXTADDRESS3'><string></string></field><field name='TXTCITY'><string>wichita</string></field><field name='TXTSTATE'><string>KS</string></field><field name='TXTZIP'><string>67209</string></field><field name='INTCOUNTRYID'><number>1.0</number></field><field name='TXTPHONE'><string>3169450278</string></field><field name='TXTFAX'><string></string></field><field name='TXTEMAIL'><string></string></field><field name='DATCREATED'><dateTime>2008-8-6T20:14:1-5:0</dateTime></field></recordset></var>

Open in new window

0
Comment
Question by:monica73174
1 Comment
 
LVL 14

Accepted Solution

by:
SBennett earned 500 total points
ID: 22772348
When you use cfwddx to convert the wddx to cfml it automatically creates a structure with the variable name you specify in the output parameter. based on your wddx packet it looks like it would create a coldfusion structure named orders that has a structkey of customer_addresses that contains a query result set. You could loop through that result set like this:


<cfwddx action="CFML2WDDX" input="#mywddxstring#"  output="orders">
 

<cfoutput query="orders.Customer_Addresses">

#orders.Customer_Addresses.STRTABLE#<bt>

#orders.Customer_Addresses.GUIDADDRESSID#<br>

#orders.Customer_Addresses.GUIDCUSTOMERID#<br><br>

</cfoutput>

Open in new window

0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now