7

The intent is to create a set of web services that people can reuse. These services mostly interact with a backend DB creating, retreiving and processing data.

We want to expose services so that people can use to create data mashups and other applications.

End users are webpages that can be within our domain or outside our domain. For pages outside the domain we plan to release widgets that would be configured to retreive and display the data.

One requirement - application should be extremely scalable in terms of the number of users it can handle.

Our code base is .net and we are looking at ASPX webmethods (or ASHX), ASMX webmethods and WCF (starting to read up on WCF).

In terms of security/access I found that maintaining sessionid, memberships is doable in all three. WCF seems a bit complicated to setup. I could not immediately see the value of asmx when we can get all done just using a webmethod in aspx (with a little tweaking).

Also, assuming that with the ASP.NET MVC2 I might be able to get clean urls as well for these webmethods.

Questions

Which one will be the most effective in terms of performance and scalability? Any reason why I should choose WCF or ASMX?

Thank you for taking the time to read through this post and apologies for the naive questions since I am new to .net.

EDIT I kind of understand that WCF is the way to go. Just to understand the evolution of the technologies it would be good if someone can throw light on why a aspx webmethod is different from an asmx when similar things (apart from discovery) can be accomplished by both. The aspx webmethods can be made to return data in other formats (plaintext, json). Also, it seems that we can build restful services using ashx. Apologies again for the naive questions.

Community
  • 1
  • 1
user529265
  • 820
  • 10
  • 27

3 Answers3

9

You should use WCF for developing webservices in .Net. WCF is highly configurable with many options for security, transport protocols, serialization, extensions etc. Raw performance is also significantly higher. Also WCF is being actively developed and many new features being added in version 3.5 and 4. There are also variations like WCF data services and WCF RIA services. WCF 4.0 also has better REST and JSON support which you can directly use in ASP.Net / JQuery.

softveda
  • 10,858
  • 6
  • 42
  • 50
  • I've been wondering what was the point of using WCF and your response made me change my mind. It's great to see that Jquery is getting so much support. – Ives.me Dec 03 '10 at 22:49
  • JQuery support will improve even more. You can already get WCF Web API pre-release version. http://wcf.codeplex.com/wikipage?title=WCF%20jQuery – softveda Dec 03 '10 at 23:18
  • ASMX pages provide JSON support as well. http://encosia.com/asmx-and-json-common-mistakes-and-misconceptions/ – mattmc3 Jul 11 '11 at 01:50
3

ASMX is considered deprecated technology and replaced by WCF. So if you are going to start new development which requires exposing reusable services, WCF is the way to go.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • 3
    Do you have an actual resource you can cite concerning your assertion that ASMX is deprecated? – mattmc3 Jul 11 '11 at 01:50
  • 1
    Link to documentation for wsdl.exe tool for .NET 3.5: (http://msdn.microsoft.com/en-us/library/7h3ystb6(VS.90).aspx). Notice the text "This topic is specific to a legacy technology. XML Web services and XML Web service clients should now be created using Windows Communication Foundation (WCF).". – dana Dec 12 '11 at 21:41
1

I am not necessarily disagreeing with previous answer. But, from a different perspective, WFC is tricky to configure. It requires bindings, endpoints, packet sizes, a lot of confussing parameters, etc in your configuration files, and there are many serialization/deserialization issues reported. Also WCF is a relatively new technology (therefore still exposed to bugs and patches needed). The client-generated [Reference.cs] files might have unwanted interfaces, and each public property client class exposed in the WSDL gets generated with the same observer pattern that LINQ to SQL or Entity Framework uses ( OnChanged, OnChanging, etc) so this adds a lot of fat to the client code, as opposed to the traditional SOAP Web client way. My recommendation, if you aren't using Remoting over TCP or if you don't need the 2-way notification mechanism for remote changes - all these are very cool features of WCF - you don't need to use it.

  • 2
    -1 Your information is out of date. Among other things, WCF has been out since 2006. You can also easily arrange to not generate INotifyPropertyChanged, which has nothing to do with remote changes. – John Saunders Feb 20 '12 at 14:29
  • you should not pass domain models through WCF anyway. – Neil Hosey Jan 19 '15 at 15:57