[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Calling a webservice from flash 8-  works in preview mode but not on live site

Posted on 2006-06-24
3
Medium Priority
?
678 Views
Last Modified: 2008-08-14
Hi,

i am experienced in working with webservices and calling them from various languages.  however, im not very experienced with flash and im trying for the first time to call a webservice function from actionscript in flash.  

i have the flash code working in preview mode - i.e. when i press F12 and it runs locally, i click the submit button and the code correctly calls the webservice function and returns the desired result.

however, when i export the movie, upload it to the live site and then browse to the site, the webservice function call no longer works - i dont get any return - its as if its not calling it at all or its crashing out somewhere during the call.

is there something different i need to do when deploying the movie, so that it will work on the live site?

here is the code for calling the webservice...

on (release)
{
      import mx.services.*;

      var strParam:String;
      var blnResult:Boolean;
      
      strParam= "test";
      ws= new WebService("http://www.myserver.com/ws.asmx?wsdl");
      cb= ws.fnTest(strParam);

      cb.onResult = function(result)
      {
            if (result == "true" ) {
                  txtSuccess._visible=true;
                  txtFailed._visible=false;
            }
            else {
                  txtSuccess._visible=false;
                  txtFailed._visible=true;
            }            
                        
      }      


}

as i said, this works fine in preview mode, but once i upload it to the server, it doesnt work.

please help!

thanks!
0
Comment
Question by:sdlangers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 49

Accepted Solution

by:
Roonaan earned 375 total points
ID: 17046563
You might need to add a crossdomain.xml file to your servers webroot. More details can be found all around.

-r-
0
 

Author Comment

by:sdlangers
ID: 17046680
thanks - i had actually found the answer - this question is nearly 2 weeks old - it needed a proxy web service installed on the same domain - so its related to the crossdomain.xml solution you mentioned, so i'll just give you the points anyway
0
 
LVL 49

Expert Comment

by:Roonaan
ID: 17048405
With crossdomain.xml you therefor don't need to run the flash and webservice on the same domain. Thats what it does.

But thank you for your points.

-r-
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question