Solved

Flex/Webservice Permissions Problem

Posted on 2009-04-10
4
639 Views
Last Modified: 2012-05-06
Hi, I'm trying to create a test "Hello World" app on our IIS server.  When the user clicks a button a pop up should say "Hello World!", which is a string returned by a WCF web service on the same server.  I have no problem getting the service to work on an aspx page.  But in Flex debugger I get the error:
 
[SWF] /TestProject2/TestProject2.swf - 1,110,380 bytes after decompression
Warning: Domain our-server.local.ourserver.com does not specify a meta-policy.  Applying default meta-policy 'master-only'.  This configuration is deprecated.  See http://www.adobe.com/go/strict_policy_files to fix this problem.
 
Error: Request for resource at http://ftp-server.local.mycompany.com/Service_Upload.svc/basic by requestor from http://upload.mycompany.com/TestProject2/TestProject2.swf is denied due to lack of policy file permissions.
 
*** Security Sandbox Violation ***
Connection to http://our-server.local.mycompany.com/Service_Upload.svc/basic halted - not permitted from http://upload.mycompany.com/TestProject2/TestProject2.swf
 
 
I've created a crossdomain.xml file and tried various settings to try to open up access, including adding *.mycompany.com *.local.mycompany.com, etc., and at the moment I'm using this.
 
<?xml version="1.0"?>
<!-- http://upload.mycompany.com/crossdomain.xml -->
<cross-domain-policy>
    <allow-access-from domain='*' to-ports='*' />
</cross-domain-policy>
 
I got a demo project to call an external service.  Why am I getting this permissions error on my own server, especially when the service and the swf are on the same server and the crossdomain.xml seems to clearly open up permissions?
<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:Script>

<![CDATA[

	import com.cushingco.HelloResultEvent;

    import com.cushingco.Service_Upload;

    import mx.controls.Alert;

    public function sayHello():void {

        var service:Service_Upload = new Service_Upload();

        service.addhelloEventListener(

            function (event:HelloResultEvent):void {

                Alert.show(event.result);

            });

        service.hello();

    }

]]>

    </mx:Script>

    <mx:Button x="296" y="54" label="Click to receive greeting" click="sayHello()"/>

</mx:Application>

Open in new window

0
Comment
Question by:dparkes
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
Fuzzy_Logic_ earned 500 total points
ID: 24123151
First impressions from this:

There is no cross-domain.xml in our-server.local.ourserver.com/

There is a cross-domain.xml in upload.mycompany.com/

The cross-domain.xml needs to be in the folder from which data is being requested from.

Place the cross-domain file in our-server.local.ouserver.com/
0
 
LVL 5

Expert Comment

by:Fuzzy_Logic_
ID: 24123167
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 24125744
In which folder is the crossdomain.xml file located? It needs to be in the root folder of the domain being accessed.
0
 
LVL 1

Author Comment

by:dparkes
ID: 24139183
Fuzzy Logic,
Thanks, that helped me come up with the simple solution to just point the debugger to  http://ftp-server.local.mycompany.com/TestProject2/TestProject2.html (it's internal name) instead of http://upload.mycompany.com/TestProject2/TestProject2.html.
 
Although both url's point to the same place, Flex apparently didn't like the domain names being different.
 
The error is gone now.  The event is still not firing and nothing happens when I press the button though.  But I suppose that is a separate problem.  
Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

746 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

12 Experts available now in Live!

Get 1:1 Help Now