开发者

Silverlight Accessing WCF and CrossDomainAccessPolicy without IIS

开发者 https://www.devze.com 2023-02-02 16:53 出处:网络
I have a Windows Service that exposes a WCF service and so I\'m not using IIS.I\'m suddenly getting the famous SecurityException that mentions using a cross-domain policy when I try开发者_如何转开发 t

I have a Windows Service that exposes a WCF service and so I'm not using IIS. I'm suddenly getting the famous SecurityException that mentions using a cross-domain policy when I try开发者_如何转开发 to access the service from a Silverlight app. However, since I'm not using IIS, does that mean I need to have a web server on the same port as my WCF service just to serve this file? Is there a better way to do it?


You can add another service with webHttpBinding (REST) that serves out ClientAccessPolicy.xml file. Then in your Windows Service, you can start that endpoint along with the other one so that Silverlight clients can get the cross-domain policy file. You can find more information in below links:

  • Step By Step - Using Silverlight to Access a WCF Service Hosted In a Console Application
  • Self hosted WCF service and enabling cross domain calls
0

精彩评论

暂无评论...
验证码 换一张
取 消