C#WCF的Web API + JSONP [英] C# WCF Web API + JSONP

查看:310
本文介绍了C#WCF的Web API + JSONP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一种简单的方法来获得JSONP工作为新的WCF的Web API REST服务?

我已经没有运气尝试这种

 < standardEndpoints>
  < webHttpEndpoint>
    < standardEndpoint NAME =
                      helpEnabled =真
                      automaticFormatSelectionEnabled =真
                      defaultOutgoingResponseFormat =类JSON
                      crossDomainScriptAccessEnabled =真/>
  < / webHttpEndpoint>
< / standardEndpoints>


解决方案

<一个href=\"https://alexanderzeitler.com/articles/Look-Ma,-I-can-handle-JSONP-%28aka-Cross-Domain-JSON%29-with-WCF-Web-API-and-jQuery!/\" rel=\"nofollow\">https://alexanderzeitler.com/articles/Look-Ma,-I-can-handle-JSONP-%28aka-Cross-Domain-JSON%29-with-WCF-Web-API-and-jQuery!/

更新:
最新的WCF的Web API位附带集成JSONP支持,而使用几乎类似于上面的链接描述的方式。

Is there an easy way to get JSONP working for the new WCF Web API rest services?

I've tried this with no luck

<standardEndpoints>
  <webHttpEndpoint>
    <standardEndpoint name=""
                      helpEnabled="true"
                      automaticFormatSelectionEnabled="true"
                      defaultOutgoingResponseFormat ="Json"
                      crossDomainScriptAccessEnabled="true"/>
  </webHttpEndpoint>
</standardEndpoints>

解决方案

https://alexanderzeitler.com/articles/Look-Ma,-I-can-handle-JSONP-%28aka-Cross-Domain-JSON%29-with-WCF-Web-API-and-jQuery!/

Update: Latest WCF Web API bits ships with integrated JSONP support whereas usage is almost similar to the way described in the link above.

这篇关于C#WCF的Web API + JSONP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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