0
votes

I have created a WCF Service library that is called from a Silverlight application.

The .svc file (GVFileManagementService.svc) is hosted on the web project that host also the xap.

Now, the GVFileManagementService.svc contains only a reference to the dll.

Locally, everything works fine. But when I deployed the solution on the server the xap didn't work and I noticed in Fiddler that the application is requesting the crossdomain.xml and the clientaccesspolicy.xml files.

The https are : http://localhost:1186/clientaccesspolicy.xml

and http://localhost:1186/crossdomain.xml

Why it indicates a localhost URL ? And how can I resolve this issue ? Where should I place these files ?

Thanks

3

3 Answers

1
votes

The client access and cross domain policy files need to be in your root web directory. Fiddler is showing the localhost address because you are running off of your local web server on a specific port.

You might check out this article. http://msdn.microsoft.com/en-us/library/cc197955%28v=vs.95%29.aspx

1
votes

Your problem may be that the XAP file is being built with a reference to the local host service being used in your development environment. That is what is being put in the XAP file and why the silverlight client is looking to localhost when you try to use it. You need to create a relative binding so that when the silverlight client starts asking for the service, it substitutes the name of the service on the deployed machine.

This link Using relative URLs to access WCF services in Silverlight may help explain what is happening and how to do it.

0
votes

Because of the sandbox nature of Silverlight, in order to access resources from different network you need to have client access policy and if you are accessing a different domain then a cross domain policy as well.