locked
Clientaccesspolicy SL RRS feed

  • Question

  • Hi, I have set up a WCf service and are making an attempt to call it from SL. The return from the async call dies on the famous message that the connection will not happen due to a missing cross-domain policy. I have a valid clientaccesspolicy in xml but do not know what to do with it, due to the fact that my WCF service runs self-hosted. I saw Carlos F's blog but do not understand what he means.

    Q: how does SL make a request for the Clientaccesspolicy ?

    Q: In what format do I provide it on the server side ?

    Q: Where do I put the clientaccess policy (or does it absolutely need to be provided programatically, in which case how does SL know what to call to get the clientaccesspolicy ) ???  

     

    Friday, October 23, 2009 2:33 PM

Answers

  • Hi,

    Q: how does SL make a request for the Clientaccesspolicy ?

    http(s)://<yourdomain>//clientaccesspolicy.xml

    Q: In what format do I provide it on the server side ?

    XML

    Q: Where do I put the clientaccess policy (or does it absolutely need to be provided programatically, in which case how does SL know what to call to get the clientaccesspolicy ) ???

    If you use a self-hosted service you need generate that file when application makes request for file. Look http://blogs.msdn.com/carlosfigueira/archive/2008/03/07/enabling-cross-domain-calls-for-silverlight-apps-on-self-hosted-web-services.aspx

     

    Friday, October 23, 2009 2:42 PM
  • Silverlight infrastracture will make request before call method of service. With  WebGet(UriTemplate = "/clientaccesspolicy.xml") attribute you mark who will be process request for that url.

    Friday, October 23, 2009 3:08 PM

All replies

  • Hi,

    Q: how does SL make a request for the Clientaccesspolicy ?

    http(s)://<yourdomain>//clientaccesspolicy.xml

    Q: In what format do I provide it on the server side ?

    XML

    Q: Where do I put the clientaccess policy (or does it absolutely need to be provided programatically, in which case how does SL know what to call to get the clientaccesspolicy ) ???

    If you use a self-hosted service you need generate that file when application makes request for file. Look http://blogs.msdn.com/carlosfigueira/archive/2008/03/07/enabling-cross-domain-calls-for-silverlight-apps-on-self-hosted-web-services.aspx

     

    Friday, October 23, 2009 2:42 PM
  • Hi .. (Sergey ?),

    thx so far. Easy, I can setup a service call to return the xml (just Like CarlosF explained), But .. what do I call the service/method, and how do I know that SL will use that name to call for the policy ???

    Friday, October 23, 2009 3:00 PM
  • Silverlight infrastracture will make request before call method of service. With  WebGet(UriTemplate = "/clientaccesspolicy.xml") attribute you mark who will be process request for that url.

    Friday, October 23, 2009 3:08 PM
  • ahaaa... things are beginning to dawn ..  give me some time to figure out some things ... will get back if it works ... much obliged for your help ..

    Friday, October 23, 2009 3:34 PM