cross-domain policies in silverlight out of browser
I've a silverlight application, which is running fine.
I'm trying to use "Out of browser" and I encounter several problems. First, I can't get access to my services.
I receive a "Timeout exception", even on a simple return "testString" service call. I'm on localhost.
So I think there is maybe a problem with cross-domain policies.
I tried to put this
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
in a crossdomain.xml file
I tried to put this too:
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
But no way, I'm still getting a TimeOut exception, and in server side, my break point hasn't been reached.
So what could I have done wrong?
Where exactly should I put theses files?
Because I've a local IIS server, which ha开发者_如何学编程s only one "Site", this site has an "application", and my application has a Folder which contains services, so on which level should I put this?
Thank you very much
EDIT: In fact I don't know if this is this cross-policies problem OR if it's that because when it is in Out of Browser mode, it can't use the Windows Authentication mode(NTLM)
I finally found what was the problem!
It was a silverlight issue:
In fact I was making the WCF call in the App.xaml.cs "ApplicationLoaded" event, and once I receive the method, I was setting my RootVisual.
And it seems, that when we are in Out-of-Browser mode, you can't make a WCF call before the RootVisual has been setted.
Now I'm setting the RootVisual, and when the RootVisual is "Loaded", I'm doing my request. and it works!
精彩评论