|
View:
New views
12 Messages
—
Rating Filter:
Alert me
|
|
|
Dynamic XML(DOM)Hi
I am currenlty using a form to search for dates in a remote database. The results are returned directly in the browser in XML format. I need to setup a way to have that xml data returned dynamicaly to a page which will then give me the ability to manipulate the data returned (either display in html form or insert into a local db) We are on CF8 and im like a deer in headlights when it comes to xml. does anybody know a good starting point? Ive researched plenty but ALL the examples require an xml file to already exist on not be generated dynamically. Any help is appreciated! THanks!! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308743 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
|
|
|
|
|
Re: Dynamic XML(DOM)> I don't know how you are receiving the XML, but for example, it it was
> in a string variable called "my_xml_string_variable", all you need to do > is: > > <cfset xml_doc = xmlparse(my_xml_string_variable)> > <cfdump var="#xml_doc#"> > > That should at least get you started. Or, if you have an URL that outputs the XML, you can do: <cfset xml_doc = xmlparse("http://www.myxmloutput.com/?foo=bar&l=45")> <cfdump var="#xml_doc#"> ColdFusion will recognise that you are passing the parser an URL and request the output of it as its XML input. Pretty handy really! HTH Dominic -- Blog it up: http://fusion.dominicwatson.co.uk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308748 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
|
|
Re: Dynamic XML(DOM)"...I don't know how you are receiving the XML, but for example, it it was
in a string variable called "my_xml_string_variable", all you need to do is:" This is where the confusion is. I am not sure how to parse the XML data that is returned into a variable. You are correct in that the XML is returned from a remote web service. What i am trying to do is take the results, put them into an array and then more likely than not insert it into a local DB. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308749 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
|
|
Re: Dynamic XML(DOM)Dominic,
The remote webservice requires data to be POSTed to it and will not accept GET. Will the xmlparse work with POST requests? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308751 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
|
|
|
|
|
Re: Dynamic XML(DOM)No it won't. For that, your best bet is to use cfhttp to post the data
and store the resultant output as a variable: <cfhttp url="http://myurl.com" method="POST"> <cfhttpparam ...> </cfhttp> <cfset xmlContent = cfhttp.fileContent> <cfset xml_doc = xmlparse(cfhttp.filecontent)> <cfdump var="#xml_doc#"> I'm not sure of the cfhttp syntax off the top of my head (don't copy and paste that) but that should get you started on the right path. HTH Dominic 2008/7/8 LSD 4Me <lsd4me@...>: > Dominic, > > The remote webservice requires data to be POSTed to it and will not accept GET. Will the xmlparse work with POST requests? > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308753 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
|
|
Re: Dynamic XML(DOM)Oops, my code shoulda looked like:
<cfhttp url="http://myurl.com" method="POST"> <cfhttpparam ...> </cfhttp> <cfset xml_doc = xmlparse(cfhttp.filecontent)> <cfdump var="#xml_doc#"> Dominic -- Blog it up: http://fusion.dominicwatson.co.uk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308756 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
|
|
Re: Dynamic XML(DOM)"...When you say XML data, you're not referring to a SOAP packet are you?"
Yes, it is a SOAP packet returned in XML format. The API that was written for the remote webservice has plenty of SOAP related requests but we are using the HTTP POST method insteatd of creating a full blown API on our side. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308758 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
|
|
Re: Dynamic XML(DOM)Dominic!!!!
You the man. Thats exactly what i neeeded. Now that I can have the data parsed I can manipulate it. THANK YOU SO MUCH!!!!! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308759 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
|
|
|
|
|
Re: Dynamic XML(DOM)Brad,
This may work even better as this will probably allow for a better integration. I will start messing around with it now. THANKS! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308764 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4 |
| Free Forum Powered by Nabble | Forum Help |