English 中文(简体)
What is the best choice for making AJAX calls to a WCF service?
原标题:

The Microsoft AJAX Library Preview 6 and jQuery provide several ways to make the sorts of calls I need:

  • Sys.Net.WebRequest (ASP.NET Ajax)
  • Sys.Net.WebServiceProxy (ASP.NET Ajax)
  • $.ajax (jQuery)

Sys.Net.WebRequest offers a way to specify the verb ("GET", "POST", "PUT", and "DELETE"), but no built-in callback for a failed request (they all seem to use the same callback, success or fail).

Sys.Net.WebServiceProxy seems to only do "GET"/"POST" (via the "useGet" parameter on the invoke method). There are callbacks for both success and failure.

$.ajax offers a way to specify the verb, has both success/failure callbacks, and can specify timeout length (among other things).

From the standpoints of maintainability, reliability, and usability, which of these would be the best method to standardize on when making AJAX calls to a WCF service (which returns JSON results)?

jQuery seems to do everything I want, but I could be missing something with the MicrosoftAjax library (as it s so big...). If I m missing anything, or don t have my facts right, let me know!

Thanks!

最佳回答

I have to say, go with jQuery - not only does it do everything you need, but it is going to be more common than MicrosoftAjax because it is being used outside of Microsoft technologies. Part of maintainability is using frameworks that are in common use and jQuery is exactly that.

问题回答

暂无回答




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签