Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an advantage to using WCF to facilitate AJAX calls?

I am currently reading through a proposal, where this person is proposing to use WCF services to facilitate AJAX calls in a web application. They say that WCF can serialize data more efficiently. I personally have never considered going this approach. I have always liked calling MVC controllers using jQuery's AJAX functionality, and that has never been a problem.

Now there is this proposal to use WCF for AJAX, and i'm a little sceptical. I would like to keep and open mind. To me it seems to add another layer, unnecessarily complicating things. Is this worth it?

like image 779
7wp Avatar asked Mar 01 '23 00:03

7wp


1 Answers

As a side note, ASP.Net MVC currently uses the JavaScriptSerializer (even though it has been marked as obsolete post .Net 3.5) for serializing JSON data where WCF uses the DataContractJsonSerializer.

So in terms of JSON serialization efficiency, MVC will be more efficient as the JavaScriptSerializer is alot more lightweight (all be it quick and dirty) than the DataContractJsonSerializer.

HTH

like image 115
Simon Fox Avatar answered Mar 07 '23 07:03

Simon Fox