Solved

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

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

726 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