Solved

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

Posted on 2008-10-21
1
809 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 14

Accepted Solution

by:
Scott Bennett 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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