3 Replies Latest reply on Apr 21, 2009 1:52 PM by Gregory Lafrance

    HTTPService question

    RevPeters

      I'm working with a simple web app that monitors an xml file that's output by an application server program. At the moment, I have the location hardcoded in using a mapped network drive (lame indeed). It works fine with AIR projects and an application without webservices (just testing it out while making it).

       

      Eventually the web app will just sit on a Tomcat host http://localhost:8080/junx/junx.html on the application server with the other program (unless the boss changes his mind again). What should I do to get access to this file with HTTPServices? Everything below is what happens when I've tried so far.

       

           <mx:HTTPService id="etlStatus"
                url="W:\temp\I\ietl.xml"
                result="httpResultHandler(event)"
                fault="httpFaultHandler(event)"
                resultFormat="e4x" />
      

       

      The fault even is just an alert window. The xml parsing works fine. I just can't access it when it's running from http://localhost:8080/junx/junx.html.

       

      Thanks for the guidance! (feel free to assume I don't know what you're saying because I'm still new to the Flex world).

        • 1. Re: HTTPService question
          Gregory Lafrance Level 6

          Often you develop a Flex app and don't have to worry about networked resources, as in your case where it is a local file, but when you post it to the web, you need to specify either the relative path to the file on the server, or the full URL.

           

          If the file resides in another domain you need a crossdomain.xml file setup. www.mySite.com and www.new.mySite.com are considered different domains.

          • 2. Re: HTTPService question
            RevPeters Level 1

            Would it work if the xml file was on the same machine as the tomcat install the program is running on? The url="C:\temp\I\ietl.xml" in the code and have it running from that same machine. If it were to work in this case it should work with a mapped drive also, however.

             

            I tried that also but it, also, didn't work. Not sure If that's exactly what you meant. I'll keep it in mind when I have to talk to the boss man though.

             

            Thanks for answering!

            • 3. Re: HTTPService question
              Gregory Lafrance Level 6

              Your Flex app will be hosted somewhere under the web root on the server. Just have the file somewhere under that folder if possible.