开发者

Still having issues with my cross domain policy in Silverlight 3.0

So I'm using both xml files listed below with no luck. They both exist in the root of my IIS hosted web service on a different web server (behind the firewall). The web service is a simple POX like service that returns a JSON string.

Also I'm trying to get access to this service from a cassini run project on my local machine (to test it out). I can view the JSON from a browser but get a security error in silverlight when I try to do an HTTP GET using the same uri (4004 is the error code shown)

Anything simple that I missed here?

clientaccesspolicy.xml

<?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"/>
      &开发者_StackOverflow中文版lt;/grant-to>
    </policy>
  </cross-domain-access>
</access-policy>

crossdomain.xml

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <site-control permitted-cross-domain-policies="master-only" /> 
  <allow-access-from domain="*" secure="true" /> 
</cross-domain-policy>


Are you using a tool like fiddler to see what address the request for the cross domain policy file is pointed at? That's usually my first check; if the policy file isn't being found I'll know where it's supposed to be and if it is then I usually need to look elsewhere.

Your clientaccesspolicy.xml is identical to my reference one. Should be no problems there.


If you get a 404 response code, the only reason can be that the server can not find the resource you are looking for. So are you absolutely sure you are using the correct url?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜