Skip to main content

Microsoft Silverlight

Unanswered Question SecurityException when calling WCF serviceRSS Feed

(0)

chrisortman
chrisortman

Member

Member

0 points

4 Posts

SecurityException when calling WCF service

I am getting a SecurityException when calling a cross domain service from silverlight RC0

I have this in c:\inetpub\wwwroot\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"/>
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>

 And I verify using WebDevHelper that this file is requested and comes back with a 200 status

My services is hosted at /virtualroot/service.svc

Everything works fine if calling from the same domain.

I'm not even sure what else to check.

Edit: I have managed to figure out one more thing...This fails when I view my test page using file:///c:/code/project/bin/debug/testpage.html but does work if I start a web server and view the page over http

Is there a way around this? Being able to use file:/// for development purposes is very handy.

Thanks

amit_pal1979
amit_pal...

Participant

Participant

1150 points

201 Posts

Re: SecurityException when calling WCF service

Thanks I refreshed the page and saw you have edited the post.

What you are trying to achieve is currently not possible. SL currently supports http>>https or vice versa however file>>http(s) or vice versa is not supported.

 

Please mark the post as 'Answered' if this Answers your question

chrisortman
chrisortman

Member

Member

0 points

4 Posts

Re: SecurityException when calling WCF service

Bummer. Just to satisfy my curiosity do you happen to know why? I don't understand how the fact that the page was rendered from a file:/// source could impact the call to an http:// server Cheers

Yi-Lun Luo - MSFT
Yi-Lun L...

All-Star

All-Star

25052 points

2,747 Posts

Re: SecurityException when calling WCF service

Hello, this is by design. Full cross scheme is not supported. For example, file to http is not supported.

shanaolanxing - I'll transfer to the Windows Azure team, and will have limited time to participate in the Silverlight forum. Apologize if I don't answer your questions in time.

chrisortman
chrisortman

Member

Member

0 points

4 Posts

Re: Re: SecurityException when calling WCF service

I understand it is by design, my question is why design it this way.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities