Solved

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

Posted on 2006-06-24
3
672 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
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 how to record live broadcast.

919 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now