0
votes

I have a typical Silverlight 5 application created on Azure with a web project that hosts the site hosting the Silverlight XAP file and another web project that hosts a collection of WCF Data Services.

Together the two sites run in a single Azure role but on different ports. Port 80 hosts the WCF Data Services and Port 8081 hosts the actual Silverlight application.

I am having a cross-domain issue with this configuration. In watching through Fiddler, it appears that when my Silverlight application calls the Service, it is, as expected, looking for the clientaccesspolicy.xml and crossdomain.xml files from the WCF Data Services site to be allowed cross-domain access. However, the Silverlight application is sending the request to http://127.0.0.1 and not the correct URI for the domain in which the WCF Data Services are hosted.

Can anybody explain to me why the application is trying to go to 127.0.0.1 and not the correct URI?

Thanks

1
is this happening deployed or in the emulator?Simon Opelt

1 Answers

1
votes

Your Silverlight application has a file named "ServiceReferences.ClientConfig". That file has been created when you added the service reference. And because you added the service reference from 127.0.0.1, your file is configured that the service endpoint is on 127.0.0.1.

What you have to do, is to manually change the ServiceReferences.ClientConfig file, before you deploy, to fix the service endpoint address (and set it to the domain you are using).

Or you can use mine approach to handle this kind issues.