3

As stated in this article by Microsoft you need to host a xml config file on the webservice from which you application was downloaded to allow the application to make cross domain calls.

Are there any workaround for this? My silverlight application can be run OOB or possibly hosted on some random webserver (where a crossdomain.xml or clientaccesspolicy.xml cannot be placed).

The calls i need to make from the silverlight application are calls to various json webservices (using the SilverlightServiceClient from ServiceStack), but i do not know the URL in advance.

Cheers!

Johnny
  • 313
  • 1
  • 5
  • 10
  • 1
    The cross domain file is required on servers that are not in the domain serving up the Silverlight app. If it is only calling back to the site that installed the app you may be OK without (or you may have to drop OOB if OOB always requires it). – iCollect.it Ltd Aug 14 '12 at 10:41

2 Answers2

2

It sounds like you are not actually in a Cross Domain scenario, but not sure where your JSON services are located. The article you refer to relates to where you want to call services on a server other than the one hosting the Silverlight app.

If the JSON services are on other machines, out of your control, then you should be calling them from your webserver and not your client. Then there is no Cross Domain issue. You just wrap the calls in your own API on your own web server (which also gives you an extra level of separation in case a third-party service goes away).

The only thing I am not sure about is if OOB mode remembers what server it came from (but I think it does).

iCollect.it Ltd
  • 92,391
  • 25
  • 181
  • 202
  • Yes, OOB mode remembers where it comes from. One obvious proof is the automatic update feature. – jv42 Aug 20 '12 at 09:28
0

See this question on how you can use Global (or per-service) HTTP headers to enable CORS with ServiceStack:

servicestack REST API and CORS

Community
  • 1
  • 1
mythz
  • 141,670
  • 29
  • 246
  • 390
  • The Silverlight client enforces the cross-domain access restrictions. Can you explain how the `servicestack` that would help in this instance? – iCollect.it Ltd Aug 14 '12 at 19:09
  • I have read the overviews... but they do not appear to answer how using that technology would be applicable to this *Silverlight specific* problem. Can you please explain in simple terms? – iCollect.it Ltd Aug 14 '12 at 19:34