Welcome, Guest
  • Author Topic: proxy script for grabbing XML using CF.  (Read 3096 times)

    tudd

    • Server what's that
    • *
    • Posts: 2
      • View Profile
      • Email
    proxy script for grabbing XML using CF.
    « on: 04/09/02, 12:17 »
    I can get a XML document using ColdFusion and CFHTTP...

    question is what kind of variable do I put the resulting XML content into...

    and then how do I reference that with flash?


    the XML resides on a third party domain and I need to supply my site with it's content.

    Flash-db

    • Administrator
    • Systems Administrator
    • *****
    • Posts: 1876
      • View Profile
      • Flash-db.com
    Re:proxy script for grabbing XML using CF.
    « Reply #1 on: 04/09/02, 21:41 »
    As long as your able to grab the info from the other site using a CF script - then you could do something like this:

    myXML = new XML();
    myXML.onLoad = convertXML;

    myXML.load("YourCFXMLGrabberScript.cfm");

    function convertXML () {

    ......

    }

    The script goes out - grabs the XML.  You could not have to assign any type of variable in this case - You would only want to grab the exact format and content of the XML on the other site - then print it out to the script the same way.  That will then be read in by Flash - and you can do all that XML conversion/formatting stuff just like on your other flash movie that your using on a different site.
    Flash-DB

    tudd

    • Server what's that
    • *
    • Posts: 2
      • View Profile
      • Email
    Re:proxy script for grabbing XML using CF.
    « Reply #2 on: 04/12/02, 09:11 »
    after the load function and before the convert function

    is there a way to error check to see if the file was loaded or in the convert function to tell if the XML returned was not in error?

    I want to display error message if the document was unretreivable or in error in any way.

    Flash-db

    • Administrator
    • Systems Administrator
    • *****
    • Posts: 1876
      • View Profile
      • Flash-db.com
    Re:proxy script for grabbing XML using CF.
    « Reply #3 on: 04/18/02, 20:25 »
    Yes you can either build that part into your CF script - or into the Flash client.  Since you have to use a proxy script in this case it might be best to do this in your CF script.  

    It's just going to be a simple If/Else statement - Like if it was successful print out the xml - else print out an error message to send back to flash.

    A way to test this initially is to just type in the URL to the CF script and make sure that everything is being printed out to the screen correctly.
    Flash-DB