crossdomain or clientaccesspolicy files

Dec 17, 2008 at 9:42 PM
Just started evaluating the MSE engine.  Started by making a simple WCF service that was consumed by a silverlight application.  when I published this service and silverlight app to the localhost iis system, I had to put a crossdomain.xml file at the root of the host in for for silverlight to be able access the service.  After doing that, it worked fine.  Now I import that wcf service into mse and host it in a runtime server.  Where does the crossdomain.xml file end up at this point?  when I change the silverlight app to consume the MSE service, it fails and tells me I need a crossdomain.xml file to consume the service...
Developer
Dec 19, 2008 at 3:41 PM
You are certainly starting out with an interesting scenario.  We haven't specifically looked at how to address this yet, but essentially you would need two endpoints in the MSE.  One would be your service as you have done, but the other would be an endpoint that provided the expected HTTP response for the crossdomain.xml file expected by Silverlight.  I suspect it would be an endpoint that responds to HTTP GET requests with the response being the text of the crossdomain.xml file.  Such and endpoint would require defining an appropriate WCF Binding the MSE Endpoint would use along with a Policy that injects an IDispatchMessageInspector that constructs the correct response message in BeforeSendReply().

Hope that helps.
Dec 19, 2008 at 3:57 PM
It certainly points me in the right direction...but an example would be much more helpful....

Just guessing here, but most of the folks strarting to look at MSE will not be as well-versed in the technology as you folks are, and the learning curve will be daunting.  These are simple concepts to be sure, but to the uninitiated, this is more than a little confusing...

Now add to that the fact that Microsoft is pushing Silverlight, and it has "special needs" as it relates to services it can consume (basicHttpbinding, clientaccess or cross-domain policy files, etc, ) and you can see the need for some concrete examples that show MSE playing well in this type of environment would be very very useful...

I can play around with the info you gave me and see if I can come up with a simple way that it can work...
Feb 5, 2010 at 5:38 PM

I don't have a perfect solution for this problem but at least a good workaround.

On the same machine where MSE is installed, create a new Web Site on IIS with the same port as the MSE virtual endpoint and drop the required files (crossdomain.xml or clientaccesspolicy.xml) on this Web Site.

With this solution, IIS will handle the static HTTP requests and MSE will handle the remaining requests as usual.

Hope that helps.