Maybe I am posting on the wrong forum. Is that a better one to use? Thanks Archie
Archie Campbell wrote: > I am finding this task uncharacteristically difficult to do with Cold > Fusion. > I suspect there is an easier way, I just cant think of it. > > Here is the situation. > > There is an external Webservice that returns XML containing information > on all unpaid invoices for a customer. > The XML document contains 1 or many invoices each having 1 or many > invoice detail lines. > The CF program I am writing is supposed to: > . call the webservice > . get the XML info and either: > A. save it in an XML text file for further processing by > Excel or Access or another CF program or ... > B. convert it to a struct, process it a bit, like total > fields, rename fields > producing a new struct which is then saved to an XML > text file > > The external (non CF) webservice returns a "complex" structure like: > > InvoiceCollection > . countOfInvoices > . totalAmount > . Invoices: (repeating multiple times) > . invoiceNumber > . invoiceDate > . invoiceAmount > . countOfInvoiceLines > . InvoiceLines (repeating multiple times) > . lineNumber > . description > . amount > > I have successfully accepted the webservice return object and produced a > CF struct from it. > It was a bit tedious, but I have it done. > > After I had the struct I thought I could use the data conversion routine > StructToXml from cflib.org to produce a string that I would write to a > file with cffile. > It was missing the arrayOfStructs. Not much there. > Then I read the fine print on StructToXml and noted that it says it > converts "simple" structs. > A struct whose elements include an array of stucts is not included in > the definition of simple. > Darn I said. > > Basically, right now, I have my struct and I am stuck. > What I originally thought to be a simple task for Cold Fusion (CF nicely > takes many otherwise complex tasks and makes them simple) > has got me stuck. > > Any thoughts would be appreciated. > > Thanks > Archie Campbell > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Enterprise web applications, build robust, secure scalable apps today - Try it now ColdFusion Today ColdFusion 8 beta - Build next generation apps Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284708 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

