如何实现跨域调用自托管的WCF服务 [英] How to enable cross domain calls for self hosted WCF service

查看:285
本文介绍了如何实现跨域调用自托管的WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了运行在Windows机器上的自我托管WCF服务。现在我想使用AJAX调用消费服务的业务。无论是在IEXPLORER,火狐也没有镀铬我得到一个生成的JSON流作为应该。

I created a self hosted WCF service which runs on a windows machine. Now I would like to consume the service's operations using AJAX calls. Neither in iExplorer, Firefox nor Chrome I get a resulting JSON stream as supposed to.

我有什么要补充的自我托管服务,以允许跨域调用?

What do I have to add to the self hosted service in order to allow cross domain calls?

问候 西蒙

推荐答案

http://pranayamr.blogspot.se/2011/06/calling-cross-domain-wcf-service-using.html 似乎是一个有效的文章。您需要相应地配置服务。这在过去为我工作。

http://pranayamr.blogspot.se/2011/06/calling-cross-domain-wcf-service-using.html Seems like a valid article. You need to configure your service accordingly. This has worked for me in the past.

这篇关于如何实现跨域调用自托管的WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆