call normal WCF service using Jquery
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) {
});
精彩评论