Solved

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

Posted on 2006-06-24
3
673 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
  • 2
3 Comments
 
LVL 49

Accepted Solution

by:
Roonaan earned 125 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
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.

770 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