A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: WebService returns value locally but not online

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    20

    WebService returns value locally but not online

    Hi all

    I am targeting Flash Player 7

    I have created a call to a webService that retrieves the result Hello World, however, the value is only retrieved and displayed when viewed locally, when viewed online I get nothing.

    The embed and object script both have 'allowscriptaccess always' and the webservice is in the same domain.

    Thankyou

    -- So I created a cross domain policy document just in case the web service resides on a different domain

    (actual paths are: http://www.website.com & http://www.website.com/yourchoices.asmx?wsdl)

    &

    import flash.system.Security;
    import flash.system.* ;
    System.security.allowDomain("*");
    System.security.loadPolicyFile("http://www.website.com/crossdomain.xml");

    Still works locally but a value is still not retrieved when viewed online.
    Last edited by lmitchsmith; 06-03-2010 at 11:50 AM. Reason: Progressive

  2. #2
    Junior Member
    Join Date
    May 2010
    Posts
    11
    The script is not working on your server - probably needs setup. If you put the url in a browser will it post back to the screen?

  3. #3
    Junior Member
    Join Date
    Nov 2009
    Posts
    20
    Thanks Meshy, it turns out that Flash even in Authoring / Test Movie environment does something called Sandboxing, which is to say it does not allow to connect to a Web Service and retrieve data. However, if you Publish locally in your browser all is well.

    To connect to a Web Service online then a cross domain policy file needs to be saved to the server on which the web service resides and the relevant import classes included in the Flash Movie

  4. #4
    Junior Member
    Join Date
    May 2010
    Posts
    11
    Quote Originally Posted by lmitchsmith View Post
    To connect to a Web Service online then a cross domain policy file needs to be saved to the server on which the web service resides and the relevant import classes included in the Flash Movie
    Glad to hear you got it going.

    What "import classes" are you talking about?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center