tags:

views:

1079

answers:

2

Recently I made the switch from using asmx web services to using wcf services, the transition is nearly finished, but I know I'm in for a lot of error checking and testing to make sure everything ported as expected.

My question is - so far I can only think of 1 good benefit to using wcf, and that is you get an easy way to implement a singleton web service.

Besides that I have to tell you, configuring a WCF Application seems way overly complicated, and I'll forever miss how easy it was to test asmx web services.

What other benefits are there to using WCF over ASMX web services?

+1  A: 

WCF allows you detach service from the physical layout and protocols. For example, you can write one service and deploy it as either REST or SOAP, or whatever that may happen in the future. ASMX is great, but it's pretty much hardcoded to SOAP. Also the idea is that you can plug-in existing features like throttling just by changing preferences, which I haven't seen much benefit of.

eed3si9n
Do you actually use REST? So far never had a requirement for switching protocols, isn't this false value?
JL
Protocol switch allows the same service to be called from the Internet using SOAP, yet internally use binary and TCP/IP.
John Saunders
I actually do use a service that acts both as REST and SOAP. There's varying degree of support for WS-* stack on different platforms, so I find REST (hardcoding to HTTPS for security, reliability, etc) to be more pragmatic cross-platform solution.
eed3si9n
ok guess it makes sense, I think the point is here, don't underestimate WCF, and it takes time getting to know it, am I right, there are a lot of good things you'll gain if you spend an extended period of time learning this new complexity?
JL
@JL: You're right, but also add: you don't _have to_ get into the complexity. You can start using features when you find you need them, and you'll find that most of the features are orthogonal to each other.
John Saunders
@John, made the switch, for the first day it was a bit more complicated than I expected, but in the end, WCF is a first class solution, and I've already found uses for it I never anticipated. I seriously anyone interested to watch all DasBlondes web casts : http://www.dasblonde.net/
JL
A: 
  • more protocol options; ASMX is IIS and HTTP only - WCF gives you HTTP, NetTcp, MSMQ, IPC - you name it
  • you can write your service once, and expose it on multiple endpoints
  • self-hosting: you can host your WCF service in a console app, a Winforms app, a WPF app, or let it be handled by IIS/WAS - but you don't have to
  • a lot more options like reliable sessions, lot more security options
  • you don't have to deal with as much "plumbing goo" in WCF as you do in ASMX - you can concentrate on your business problem, and let the config and attributes handle all the gooey stuff you don't want to deal with

to name just a few.....

Search Google or Bing for "WCF vs ASMX" and I'm sure you'll find plenty more article, blog posts and comparisons.

ASMX has passed its time - WCF is the present and the future. It can do a lot more - therefore it's a bit more to learn.

But if you check out the right sources, like these two Dotnet Rocks TV shows (Keith Elder Demystifies WCF and Miguel Castro on Extreme WCF), I'm sure you'll get a quick and hopefully painless start into WCF!

Marc

marc_s
marc_s why have you deleted your answer on the DAL-CRUD question of mine? It was the one I would accept :S
Daok