开发者

call normal WCF service using Jquery

开发者_如何学Go

I have a WCF service using the wsHttpBinding. How do i call this service using jquery? thanks

Please note that this WCF is NOT RESTful!


I am going to make an assumption that your service is a RESTful URL and that the service returns a JSON result:

$.ajax({
    url: 'http://MyServiceAddress/MyServiceRoute/MyServiceAction',
    dataType: 'json',
    type: 'post',
    success: function(response) {

    }
});

In jQuery 1.5, you can also use the deferred syntax:

var request = $.ajax({
    url: 'http://MyServiceAddress/MyServiceRoute/MyServiceAction',
    dataType: 'json'
});

request.success(function(response) {

});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜