Solved

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

Posted on 2008-10-21
1
811 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] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

726 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