3 Replies Latest reply on Nov 16, 2009 7:23 AM by Vanessa_Adobe

    Data service works from desktop, but not from server

    Vanessa_Adobe

      I am attempting to load an xml file present on an https server. This works when I run the application from my desktop, but gives me an error when I host the application on a web server.

      I assumed it is a cross-domain issue and put in an appropriate crossdomain.xml file on the https server (IIS server) where my xml file resides. I did not restart the server as I am not sure if it is required.

      I am still getting an error message while attempting to connect to the xml file. I need to know how to resolve this issue. And why does it work from my desktop, but not from the hosted server??

        • 1. Re: Data service works from desktop, but not from server
          Gregory Lafrance Level 6

          Often this is because you need to add the -use-network=true compiler option in the FlexBuilder menubar:

          Project - Properties - Flex Compiler - Additional compiler arguments:

          add      -use-network=true     and then recompile and post to server, should work fine.

          Note: if you create a "release build" and move it elsewhere on your local machine, you may need to add  -use-network=true     and then recompile for the app to be able to access local resources outside the Flex Builder environment.

          If this post answers your question or helps, please mark it as such.

          • 2. Re: Data service works from desktop, but not from server
            Vanessa_Adobe Level 1

            Hi Greg,

             

            Thanks for the reply, but this did not solve the issue.

            My cross domain xml file looks like this:

             

            <?xml version="1.0"?>
            <!-- https://supportcentral.occamsresources.com/crossdomain.xml -->
            <cross-domain-policy>
                <allow-access-from domain="www.occamsresources.com"/>

                <allow-access-from domain="*.libraries.supportcentral.occamsresources.com"/>
            </cross-domain-policy>

             

            I probably need to change the first line and also put in the secure=true/false parameter. I will be trying this out tomorrow and replying back if it solves the issue.

             

            One more thing to add is that even though my use-network parameter was false, from my desktop it was still connecting to the xml that was existing on the https server and working fine. The error I get still says security issue, so I am back to cross domain thinking.

             

            - Vanessa

            • 3. Re: Data service works from desktop, but not from server
              Vanessa_Adobe Level 1

              Hi,

               

              I resolved the issue I was facing. The cross domain xml file needs you to specify the exact domain or use a wild card.

              So instead of "https://libraries...... " I simply put in a "*.occamsresources.com". Also, I put in a secure parameter to let the server return the content in https format as my application was being called from a https domain.

               

              I think the application worked from my desktop as it didnt have any domain as such, hence no cross domain error was being thrown. I may be wrong about this desktop domain assumption. Please correct this if anyone has the correct answer.

               

              Thanks!