如何调用从jQuery的一个WCF Web服务? [英] How Do I call A WCF Web Service from jQuery?
本文介绍了如何调用从jQuery的一个WCF Web服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何可以调用从jQuery的WCF服务(我使用asp.net MVC)。这是我用ASMX web服务做的:
How can i call a wcf service from jquery (i am using asp.net mvc). This is what i used to do with asmx webservices :
$.ajax({
type: "POST",
url: "Services/MyService.asmx/DoSomething",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
//do the magic
}
});
我如何做同样的WCF服务?
How do I do the same with a WCF service?
推荐答案
里克施特拉尔有一个很好的例子,几乎是一样的,你有什么上市。
Rick Strahl has a great example, almost the same as what you have listed.
这篇关于如何调用从jQuery的一个WCF Web服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文