views:

43

answers:

1

Hi, my team is building a game in flash to be embeded in a asp.net application.

When the game is over the player have the chance to type his name to save his score. This is done using web services called from flash. The webservice receives the name and score.

Since the webservice is publicly available how can I make it only callable from my flash given the following conditions:

  • The .swf is hosted by the same asp.net application
  • There are two domains that can access the same application (I have run previously into cross domain issues).
  • Using SSL is not an option.
  • The webservice has to be consumed by the .swf file.

Any help or code would be appreciated.

A: 

Well If you want to use ASP.NET webapplication instead of webservice , I have a solution which worked on my Project.

You can send variables from flash to you ASP.NET page using LoadVars' and 'sendAndLoad. then can get the values in .NET webpage using Request.Form. Now as you have all the variables from Flash to your .NET webpage , do what ever processing you need(Ado.NET or Sending a mail to user)

Here is a sample to get you started with though it is in ASP , can be easily used in ASP.NET.

But if your are trying to use webService connector in Flash m not sure about it and do not see why to use webservice while we can use webapp?

Crossdomain.xml (policy file) is really important here.

Subhen
The whole game is in flash and to save the score in the DB a web service in my as.net app has to be called. Or is there any other way to securely send data to my asp.net app?
Carlos Muñoz
@Carlos Muñoz, You don't need a webservice. Just in your .CS file(if you write with C#) load the Flash Variables and then save them to database
Subhen
Sending parameters via POST to a webpage isn't remotely secure. The webservice suffers from the same weakness though.
Carlos Muñoz
Agree and SSL is not an option. If you write encode and decode then it will add performance overhead .
Subhen
Performance overhead is meaningless here, the important issue is to send data from flash to c# webservice and to make sure only flash can call it.
Carlos Muñoz